Closed smemsh closed 8 years ago
Hi Scott, thanks for this report too. Yes you're absolutely right, I should follow ISO on this one.
I sketched out ISO week dates after, my own, year-month-count-weekday dates and they, for optical balance contain zero padding, both for the count of the weekday within the month and also for the weekday itself.
Fixed in 50ba3b8, thanks again for the report.
Desire to get the ISO day-in-week number. without zero-pad (it's always a single digit in range 1-7). This is possible with
date
using%u
output format, but there does not appear to be any mechanism indateutils
, and the same format confusingly differs between them (where, elsewhere, it strives to maintains consistency):I looked through all the output formats in the man page but could not find one that was not zero-padded. Really, I don't think zero-padding should ever be present anyways, because there's never two digits in the weekday number, so I don't see why it's there.
In fact, canonical ISO dates are always in a format like this:
2004-W53-6
so there's really no way to construct the official ISO date string usingdateutils
. There's no format specifier to make one of them, so you'd have to build a composite like so:which seems to defeat the purpose of
dateutils
(i.e., not having to shell out for date generation).