4 ms·
I'm puzzled as to why the behaviour of %G would be desirable. Can anyone offer an example?
by s_kilk 12y ago
I'm puzzled as to why the behaviour of %G would be desirable. Can anyone offer an example?
- danielweber 12y agoSomeone else posted: http://en.wikipedia.org/wiki/ISO_week_date http://en.wikipedia.org/wiki/ISO_week_date
- valevk 12y agoIt is used to get the year, which a week number belongs to. The current week number (1) belongs to 2015, even though it's 2014. Here, check out this calendar [0]. We are already in week 1 of year 2015. That's why you get the year 2015. Why is it useful you might ask: when you order a time-series by week number, or if you are grouping by week numbers, you would need the week number of course. But if the data is spanning over two years, you would need also the year for grouping, because you would add up weeks from different years. If you use week number + current year you get errors around the end of some years. [0] http://www.calendar-365.com/2015-calendar.html http://www.calendar-365.com/2015-calendar.html
- gpvos 12y agoNote that these are international (ISO) week numbers. US-American week numbers are different, I'm told.
- mrweasel 12y agoI image that it would be handy in some forms of accounting software. Some countries are very found of using week numbers, pretty much any government employee in Denmark uses week numbers, rather than actual dates, so you end up needing to known which year the current week belongs to, in this case 2015.
- valevk 12y agoExactly. In Germany it is very common to talk in terms of "Kalenderwoche" (calendar week). For planning, accounting, holidays...