Skip to content

Notes on Week Numbering #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions entries/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ versions:
* **`0Y`** - Zero-padded year - 06, 16, 106
* **`MM`** - Short month - 1, 2 ... 11, 12
* **`0M`** - Zero-padded month - 01, 02 ... 11, 12
* **`WW`** - Short week (since start of year) - 1, 2, 33, 52
* **`0W`** - Zero-padded week - 01, 02, 33, 52
* **`WW`** - Short week (since start of year) - 0, 1, 2, 33, 52, 53
* **`0W`** - Zero-padded week - 00, 01, 02, 33, 52, 53
* **`DD`** - Short day - 1, 2 ... 30, 31
* **`0D`** - Zero-padded day - 01, 02 ... 30, 31

Expand All @@ -76,6 +76,25 @@ state which one.
[gregorian]: https://en.wikipedia.org/wiki/Gregorian_calendar
[utc]: https://en.wikipedia.org/wiki/Coordinated_Universal_Time

The definition of `WW`/`0W` in the above list is intentionally left
ambiguous.

* There are at least four common week numbering schemes: The
[ISO][iso-week] and the [US Broadcast][us-week] standards as well
as the output of `%W` and `%U` in many implementations of `strftime`
which produce numbers in the range `[0-52]`.
Comment on lines +82 to +85

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* There are at least four common week numbering schemes: The
[ISO][iso-week] and the [US Broadcast][us-week] standards as well
as the output of `%W` and `%U` in many implementations of `strftime`
which produce numbers in the range `[0-52]`.
* There are at least four common week numbering schemes, three of which have [strftime][strftime] codes:
* `%U` 00..53, begins Sunday
* `%V` [ISO week][iso-week] 01..53, begins Monday; pair with `%G` for year
* `%W` 00..53, begins Monday
* [US Broadcast week][us-week]

* It would be tedious to determine which system a given project
actually uses.
* The last week of the year can span multiple years, so that a
version such as `2020.53` may have been published in 2021
if it was published on Friday the 1st of January 2021.

[iso-week]: https://en.wikipedia.org/wiki/ISO_week_date
[us-week]: https://en.wikipedia.org/wiki/Broadcast_calendar

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[us-week]: https://en.wikipedia.org/wiki/Broadcast_calendar
[strftime]: https://pubs.opengroup.org/onlinepubs/009696799/functions/strftime.html
[us-week]: https://en.wikipedia.org/wiki/Broadcast_calendar


Suffice it to say, there is perhaps a good reason that only few
projects use week numbers in their versioning.

# Case studies

CalVer has quite a few users. These are projects selected for their
Expand Down