Skip to content

Instantly share code, notes, and snippets.

@KrunchMuffin
Created November 28, 2018 03:45
Show Gist options
  • Save KrunchMuffin/885bbb5b9c99160d3f1633c6a67e0845 to your computer and use it in GitHub Desktop.
Save KrunchMuffin/885bbb5b9c99160d3f1633c6a67e0845 to your computer and use it in GitHub Desktop.
Days of the week for various languages
Javascript, PostgreSQL, PHP [$cal->setFirstDayOfWeek(IntlCalendar::DOW_SUNDAY);]
0 = Sunday, 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday
SQL Server [SET DATEFIRST], ColdFusion, SQLite
7 = Sunday, 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday
Python [setfirstweekday()]
date.weekday
6 = Sunday, 0 = Monday, 1 = Tuesday, 2 = Wednesday, 3 = Thursday, 4 = Friday, 5 = Saturday
date.isoweekday()
7 = Sunday, 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday
Django, MySQL [WEEK(date[mode])], Oracle
1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, 7 = Saturday
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment