Live data from Hacker News

ISO week date

en.wikipedia.org

21–30 of 91 posts

Re: ISO week date

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

how am I supposed to know when week 33 is?

Re: ISO week date

#22
post #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...

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.

Re: ISO week date

#23
post #11
post #9

Earlier quoted context omitted.

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.

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…

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

Re: ISO week date

#24
post #12
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",…

First Thursday of January is always in week 1. That is actually the only rule needed.

Why Thursday?

Re: ISO week date

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

Re: ISO week date

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

Week numbers are a staple in many countries calendar systems. In Sweden most school children follow a weekly curriculum for instance. We also mark milestones of pregnancies by week numbers as opposed to trimesters.

Re: ISO week date

#27
post #24
post #12

Earlier quoted context omitted.

First Thursday of January is always in week 1. That is actually the only rule needed.

Why Thursday?

Presumably because then you know that the majority of week 1 is in the new year.

Re: ISO week date

#28
post #14

All this complexity because we have to adhere to some pope from 400 years ago. It's just sad.

Most calendar systems are complicated because they have conflicting goals. You just can't divide the year into even, intuitive, useful segments and have it line up with one rotation of earth

Re: ISO week date

#29
post #21
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",…

how am I supposed to know when week 33 is?

You enable week numbers in your computer's calendar.

Re: ISO week date

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

Post reply on HN