Closed Earnestly closed 5 years ago
Hi Earnest,
thanks for the report. However, notice how %D
in dateutils is different from SU's (or C99's) specification. The rationale is that dateutils only covers ISO formats and uses the remaining characters freely and sometimes differently. %D
is needed for ISO year-day dates, as in 2019-019, the 19th day of 2019, a format supported in time.h
with no representation in strftime
(or strptime
).
In your example 19
is picked up as such, and the year comes from the base date (defaults to today) since it's not specified on the line.
$ echo "foo 02/24/19 22:41:40 bar" | dateconv -S -i '%m/%d/%y %T' -f '%F %T'
foo 2019-02-24 22:41:40 bar
should be what you're after.
Ah, that's fair then. I was indeed assuming strftime
notation.
dateconv
works when not using-S
:When using
-S
the input date is not properly substituted:I would have expected the following instead: