
ISO week date - emrehan
https://en.wikipedia.org/wiki/ISO_week_date
======
bshipp
It seems like some people don't understand the use case for week numbers, at
least for businesses. They allow the ability for time series comparisons for a
work week. Using the calendar date is hopeless because the 21st day of a month
could fall on any day of the week.

I want to compare the Monday of the first work week of the year to the Monday
of the first work week of last year. That's most helpful when trying to
understand sales trends, etc.

~~~
spectramax
Yep, huge companies like Intel use work-weeks for everything. For e.g.
planning huge engineering projects was easy:

    
    
      - WW02-WW16: Conceptual Development
      - WW17: CDR
      - WW18-46: Detail Design
      - WW46-48: DDR
      - WW48-52: Validation/Testing
      - WW01-02: Ship to customer
    

So you could just now know how many weeks it took exactly for each phase:

    
    
      - [14] WW02-WW16: Conceptual Development
      - [1] WW17: CDR
      - [28] WW18-46: Detail Design
      - [2] WW46-48: DDR
      - [4] WW48-52: Validation/Testing
      - [2] WW01-02: Ship to customer

~~~
inetknght
I appreciate the usefulness of using weeks to measure time. But on a side
note: less than 10% of time assigned for validation/testing and at the very
end of a project is, in my experience, extremely ambitious.

~~~
spectramax
Lol, please ignore the details, I just quickly wrote it down without thinking
to just make a point :) But I agree, its a ridiculous timeline!

------
mikl
That is a surprising amount of complexity, really makes you glad that ISO
ironed out all the details, so when I recently told our development team
composed of Swiss, German, Portuguese and Danish people that we would be going
live in week 4 (of 2020), everyone understood just fine.

I still find it strange that some countries have not adopted week numbers.
Sure, you can say something like "the week of December 21st", but simply
saying "week 52" is so much easier, and if you, like many software teams do,
work in two week sprints, it saves you from a lot of date math.

~~~
savolai
I find week numbers very cumbersome to use. Most calendars don't have them by
default and most everyday interactions around dates don't involve them. As a
result it's a burdensome and unroutined lookup in some arbitrary calendar
somewhere just to figure out ballpark distances from current moment. I much
prefer date ranges.

~~~
mikl
Depends a lot on your locale. Physical calendars around here always have them,
and all decent calendar software has an option to display them.

And if you’d grown up with it, it would be a lot more natural. Much like you
probably know what month you’re in without checking your watch, I have a
pretty good idea what week we’re in, and if someone says they can deliver
something in week 8, I instinctively know that’s late February without having
to check.

So it’s a useful shorthand in many ways.

~~~
oefrha
> And if you’d grown up with it, it would be a lot more natural.

That’s like saying imperial units are more natural than ISO units because you
grew up with them. Of course what you grew up with is more natural to you, it
doesn’t say much. The problem is not everyone grew up with it, compared to
“the week of Dec 21.”

Not saying week numbers aren’t useful, I’ve used them to label weekly results
in datasets, for instance.

~~~
rightbyte
You could argue that the "natural" part with using weeks is that the weekends
split up your working days, but there is no effect of januari becoming
februari and that weeks thus are a more natural unit for planning at work.

------
jeltz
ISO week numbers are used a lot in some industries here in Sweden. For example
education, so everyone here has encountered them at some point in their lives.

~~~
thbo
It’s the first thing I (Norwegian) turn on (or miss) in calendar
implementations. Most things are based on week number here too.

~~~
GordonS
I'm British, but have been working with Norwegian companies for many years,
and while it took a while, week numbers now feel very natural.

For those in English locales, Outlook has an option to enable week numbers in
calendar views, and mobile calendar apps have this option too (at least the
ones I've used).

------
mikro2nd
Note that `strftime` (and implementations dependent on it - hello Python!) do
_not_ implement ISO week numbers. In `strftime` all days preceding the first
Sunday/Monday (depending which date-code you pass to the function) in a year
are classified as "Week 0" as opposed to the ISO definition. This means that
`strftime` week numbers are generally 1 less than the ISO week number.

As serendipity would have it I was delving into this issue just this
morning... :O

~~~
fanf2
Here is how to format an ISO week date with strftime:

“%G-W%V-%u”

This is in POSIX

[https://pubs.opengroup.org/onlinepubs/9699919799.2018edition...](https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/functions/strftime.html)

and C99

[http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf](http://www.open-
std.org/JTC1/SC22/WG14/www/docs/n1256.pdf)

Python’s documentation explicitly says it only describes the C89 formatting
codes and that C99 has more features.
[https://docs.python.org/2.7/library/datetime.html#strftime-s...](https://docs.python.org/2.7/library/datetime.html#strftime-
strptime-behavior)

~~~
bshipp
While it's fine and good that ISO has defined week numbers, it has been less
than helpful when working with North American firms whose weeks start on
Sunday and who expect January 1st to be week 1. I've ended up having to write
custom code to handle this in my programs as most generic libraries support
ISO and not much else.

------
hansendc
As mentioned elsewhere, Intel uses "Work Weeks" for everything. It might be
great for manufacturing where a wafer takes a specific number of days to make
it through the fab, but it inflicts horrible pain on the folks who have to
deal with it _and_ the outside world. My doctor, for instance, stubbornly
pretends to not understand when I ask for an appointment in WW04!

December 30th, 2019 is WW01.1 2020 in this calendar. I bet no human in the
world knows their WW 2020 birthday.

------
rachelbythebay
The real fun with this one is when you use (assuming strftime) %G when you
really meant %Y, and so your dates flip out for a few days right around this
time of year. What's more, it's a different pattern every year.

Twitter, Apple's iOS calendar alarms, the list goes on.

------
slantyyz
There are also non-ISO variations such as the 445 calendar:

[https://en.wikipedia.org/wiki/4%E2%80%934%E2%80%935_calendar](https://en.wikipedia.org/wiki/4%E2%80%934%E2%80%935_calendar)

------
wruza
Dates are really hard (I mean data type ones, but ymmv). Numerous libraries
claim to be “standard” or to cover almost all date/time functions, but rarely
do so. Some libraries allow a developer to see a date as a primitive
value/breakdown, which may lead to hard to debug issues (unix + 86400, etc).
Leap years, leap seconds, DST, “leapy” UTC/GMT+ days, accidental month
overflow, shift date vs duration mismatch, etc. If you’re a developer and
never scratched this topic, be aware.

------
Ididntdothis
Dates and times are really screwed up as far as programming goes and there is
not much to do about it since that’s the way the earth rotates around the sun
and itself. Maybe we should start looking for a planet that has a precise 100
day year without leap years? That year can then be split into 10 weeks.
Programming on this planet would be much easier.

------
tingletech
I wrote a stupid little calendar program that uses ISO weeks
[https://github.com/tingletech/tingcal](https://github.com/tingletech/tingcal)

------
jbj
in Denmark it is quite normal to communicate by week numbers rather than
dates. works well, some people are not used to it if they didn't grow up with
it.

