Remix.run Logo
mesrik 3 days ago

Anyone else find it odd that C99 strftime() %F and %T equivalents did not make it later revisions ISO 8601 and RFC 3339 ?

https://en.cppreference.com/w/c/chrono/strftime

Man page strftime shows,

%F Equivalent to %Y-%m-%d (the ISO 8601 date format). (C99) %T The time in 24-hour notation (%H:%M:%S). (SU)

The Op linked page did not recognise these. I tried with the "%FT%T%z" which works fine with date and strftime().

I've probably used %F and %T about 20 years with no issues linux, bsd and mac that I wrote code over the years.

BTW, It would be nice to see some reference or comparison how systems stdlib implementations match with these standards if there is one.

One gripe I've got with RFC3999 and it's not nice to have the semicolon in filename if you intend to use it file or directory name. As it conflicts and easily becoome issue when not quoted while using rsync or any command that thinks colon (:) separates and indicates host name. I'm not sure if colon would cause issues with windows but there is chance it could as it's used indicating device name.

ps. I had to implement many stdlib time.h defined functions my own between -89 - 92 for my then work as Turbo C 2.0 and 3.0/3.1 did not implement these. I recall that last time I touched these and fixed issues was when I got P.J. Plaugers The Standard C Library book when it was brand new -92. When earlier proprietary C-compliers libraries sources had not been available, that Plaugers book was was great help for many :)