steinerkelvin / NoMonth

DRAFT of the NoMonth manifesto.
2 stars 0 forks source link

Implement with `date(1)` #1

Open omasanori opened 2 years ago

omasanori commented 2 years ago

Just a guess from manpages, confirmation needed. It works!

strftime as defined in ISO C99 or later supports the formats above. Even on platforms with C90 standard library, date(1) in GNU coreutils uses gnulib's implementation that provides them portably.

steinerkelvin commented 2 years ago

It would be nice for us to explain the difference of %W vs %V, and %Y vs %G. It's not even clear to me, lol.

Also, linking a man page here because the one on MacOS is not great: https://man7.org/linux/man-pages/man1/date.1.html

omasanori commented 2 years ago

Indeed. I had checked https://en.m.wikipedia.org/wiki/ISO_week_date and musl libc's strftime few days ago and am still confused. The calculation in C is slightly different from that in the Wikipedia article because January 1st is not 1 but 0 and Sunday is not 7 but 0, which makes the situation worse...