3 ms·
It 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
by valevk 12y ago
It 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.