f.zz.de
posts /

US Date vs ISO Date

Posted Wed 17 Aug 2016 07:30:24 PM CEST Florian Lohoff
in

How can a piece of software be so broken. There is an international standard for time and date which helps sorting filesnames. Its called ISO 8601. Why on earth does ANYONE think that month-day-year is a great thing to do:

/* get the archived filename to use */
asprintf(&log_archive, "%s%sicinga-%02d-%02d-%d-%02d.log", log_archive_path,
    (log_archive_path[strlen(log_archive_path)-1] == '/') ? "" : "/",
    t->tm_mon + 1, t->tm_mday, t->tm_year + 1900, t->tm_hour);

And then there is strftime to format time ...