Search code examples
dategnu-coreutils

Interpret ISO week-of-year in gnu coreutils


Gnu date is usually pretty flexible with input to its --date option. However I find it is not giving me expected results using the ISO-8601 format for week-of-year that I found on wikipedia, namely yyyy-'W'ww or yyyy-'W'ww-d:

$ date -d 2019-W14-2  # expect some variation on 2019-04-02
date: invalid date '2019-W14-2'

Is there any format with which I can ask date to tell me about the 14th week of 2019?


Solution

  • I've tracked the relevant code down to gnulib module parse-datetime. It looks like this would have to be a new feature. I'll update this space if it's ever implemented.