Week of year
Sometime I like to use the week of the year instead of the date. Until today I've been searching up a webpage every time - I don't need it often enough to bookmark, even.
Anyway, today TIL that bash will return the week from
date +%U
😲
Looks like JS is not so straightforward tho - you can google that if you need it. 😉
UPDATE: although the above usually works fine for me, I discovered that the U command assumes that weeks begin on a SUNDAY when, as we know, they actually begin on MONDAY.
The correct command is therefore
date +%W
Comments
Post a Comment