2

My customer wants to display week numbers as they show up in his wall calendar:

  1. Week #1 starts on 1st January
  2. Last week of the year (#53 or #54) ends on 31st December
  3. All other weeks start on Monday and end on Sunday

(As a consequence, first and last weeks do not necessarily have 7 days.)

Does this week number algorithm have a name?

Clarification: I already have PHP code to calculate it, I'm just curious about whether this way of identifying weeks has a commonly accepted name.

Álvaro González
  • 142,137
  • 41
  • 261
  • 360

1 Answers1

2

There isn't one - that is a completely off-the-wall approach to week numbers. Weeks normally start either with Monday or Sunday when using the Gregorian Calendar. They do not start midway. This is not a criticism of your customer, but a comment on the fact that people invent new ways looking at date arithmetic. And get in trouble migrating to new systems.

RFC 3339

http://www.ietf.org/rfc/rfc3339.txt

See also ISO 8601

jim mcnamara
  • 16,005
  • 2
  • 34
  • 51