date gives out wrong week number
week number from string format for time are wrong, date +%W gives wrong week number, need a fix.
|
I just launched it
Code:
$ date +%W Code:
%W week number of year, with Monday as first day of week (00..53) |
Depending on what the OP really wants they could try either %V or %U
%U uses Sunday as the first day of the week (starts at 00 same as %W) %V uses Monday as the first day of the week and starts at 01 instead of 00 |
Quote:
|
According to ISO 8601 it's week 3. http://en.wikipedia.org/wiki/Seven-d...Week_numbering
|
Quote:
But the OP hasn't replied why they think it's wrong. |
still from "man date"
Code:
%V ISO week number, with Monday as first day of week (01..53) EDIT: ups, beaten. |
@number22: it's difficult to provide help if we don't know what the problem really is. We can only guess. Please, translate "gives wrong week number". What number? What is it supposed to be?
|
I thought it should be 03, sorry, I was heading back to bed right after I posted this, didn't realized fast response. Especially to wildwizard, gave me the best answer, switch my script to %V.
|
All times are GMT -5. The time now is 02:01 PM. |