Week Number Australia

Glossary

ISO Weekday Numbering

The ISO 8601 convention of numbering weekdays 1 through 7, with Monday as 1 and Sunday as 7.

ISO weekday numbering is the ISO 8601 convention of numbering weekdays 1 through 7, with Monday = 1 and Sunday = 7. This matches the ISO rule that the week starts on Monday.

Contrast with Excel

Microsoft Excel's WEEKDAY function defaults to a different convention. By default, Sunday = 1 and Saturday = 7. Passing the optional argument 2 switches to the ISO convention (Monday = 1, Sunday = 7). Passing 3 returns Monday = 0 through Sunday = 6. Spreadsheet formulas that mix conventions are a common source of off-by-one errors in scheduling.

Programming language conventions

Three common languages each use a different default:

  • Pythondatetime.weekday() returns Monday = 0 through Sunday = 6. The separate datetime.isoweekday() returns Monday = 1 through Sunday = 7.
  • JavaScriptDate.prototype.getDay() returns Sunday = 0 through Saturday = 6.
  • PostgreSQLEXTRACT(DOW FROM date) returns Sunday = 0; EXTRACT(ISODOW FROM date) returns Monday = 1.

Always check the language reference before writing weekday logic. A mismatch between systems can shift schedules, payroll cycles, or calendar week calculations by a full day.

By Week Number Australia editorial team·Updated