by aaavw · 15y ago · 0 comments
The first day of the week can be sunday or monday depending on where you are.
The way to count the weeks isn't the same everywhere.
Some advice:
Default to using ISO 8601 whenever possible http://en.wikipedia.org/wiki/ISO_8601
Don't ask for more precision then you actually need (Don't ask date & time when you only need year & week)
Don't store dates and times with more precision then was actually entered (e.g. Don't ask for year & week, and then store the (calculated) first day of the week.
On my first large project I made the mistake of asking for the year & week while storing the calculated first day of the week, however using the wrong first day of the week and the wrong numbering of weeks…
No comments yet.