3 ms·
What on earth is %G even for? In what situation would that _ever_ be useful?
by craigds 8y ago
What on earth is %G even for? In what situation would that _ever_ be useful?
- gpvos 8y agoWhen you're working with ISO week numbers, and you want to know the year that the week belongs to. Lots of companies do that, for example for work schedules in all kinds of industries.
- hyperman1 8y agoYou should never use it in a day-month-year situation, but it is very useful in a weekofyear-year situation commonly encountered in bookkeeping. You have to decide what to do with the week that gets broken up when a new year starts, and the ISO standard makes sure everybody uses the same week numbers. I personally experienced how this mattered when someone in our company was unaware of ISO and decided to invent an other week schema as new standard. First came the people who complained outlook numbered them differently. Then the complaints that all other companies delivered using another system. Then it turns out data transfers from the government didn't match either. Finally one guy pops up and sends the link to ISO in wikipedia. Our whole 1000 man part of the org was in CC of the original mail, and naturally we received all reply complaints too. After a very noisy few days in the inbox, all of us knew all about ISO weeks and why they matter. Training couldn't be better.
- masklinn 8y agoSome processes work by week, so you want week-year dating, and you may in fact want ISO week-years rather than "calendar".
- brohee 8y agoIt's what numbers week in calendars... I don't like numbered weeks much myself but some people are absolutely in love with it...
- EdSchouten 8y agoThere are many companies out there that work with weekly schedules (e.g., in production). In some of those cases you're not necessarily interested in using months and days of the month. Instead, you want to use week numbers. These flags are part of strftime(), so you can generate ISO 8601 week-based dates: strftime(..., "%G-W%V-%u", ...) This will generate output along the lines of "2018-W19-7"