%W week number of year with Monday as first day of week (00..53)
Rambo wrote: I am trying to get week number from the date command using date +%W and the output is 45 but yet the week number 46
date +%V
Kev wrote: The date command numbers the weeks starting from zero. Can you not just add one ?
Rambo wrote: but when you reach week 53 it will be week 54 can do
krinDar wrote: To get the value you want ( this being week 46) you could use the following: date +%V (works on Debian 3.0, Solaris 2.7 ... ) I guess the behaviour of %W is the old method, starting the count from zero whereas %V is the behaviour defined by ISO 8601.