Live data from Hacker News

ISO week date

en.wikipedia.org

1–10 of 91 posts

Re: ISO week date

#2
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.

Re: ISO week date

#3
post #2

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.

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

Re: ISO week date

#4
post #3
post #2

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.

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

Ditto for Denmark.

Used to have an .ics laying around for that purpose.

Re: ISO week date

#5
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.

Re: ISO week date

#6
post #2

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.

A common way at Volvo Cars is to write and talk about dates in this way; week two day three, or 20wk02d3 or just 20w02d3.

Which would translate to Wednesday January 8th year 2020

It is useful for deadlines because you always now how many weeks it is left.

Re: ISO week date

#7
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

Re: ISO week date

#8
post #7

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…

Yeah, there is a lot of languages missing iso week support. Probably because it's not used in the US as much. Found this gist for getting using it in Power BI a couple of weeks ago https://gist.github.com/r-k-b/18d898e5eed786c9240e3804b167a5...

Re: ISO week date

#9
post #5

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",…

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.

Re: ISO week date

#10
post #7

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…

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...

and C99

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...

Post reply on HN