10.1126 strftime
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html
Gnulib module: strftime-fixes
Portability problems fixed by Gnulib:
- On native Windows platforms (mingw, MSVC), this function works incorrectly
when the environment variable
TZ
has been set by Cygwin.
Portability problems not fixed by Gnulib:
- The %c specifier does not work with a time retrieved through
gmtime
or gmtime_r
, since it outputs also the current time zone,
on some platforms:
glibc 2.30, NetBSD 10.0, Solaris 11.4.
- The %c specifier produces no weekday name and no month name, only a
potentially ambiguous numerical output, on some platforms:
mingw, MSVC.
- The %h specifier produces empty output on some platforms:
mingw, MSVC.
- The %r specifier produces empty output on some platforms:
mingw, MSVC.
- The %r specifier produces empty output, at least in a French locale,
on some platforms:
macOS 12.5, FreeBSD 14.0.
- The %r specifier includes an AM/PM indicator, at least in a French locale,
on some platforms:
NetBSD 10.0, Solaris 11.4.
- The %p specifier produces non-empty output, at least in a French locale,
on some platforms:
NetBSD 10.0, Solaris 11.4.
- The Windows C runtime library (which is used by MinGW) does not
support the %e specifier (and possibly the other more recent SUS
specifiers too, i.e., %C, %D, %h, %n, %r, %R, %t, and %T).
- Native Windows platforms (mingw, MSVC) support only a subset of time
zones supported by GNU or specified by POSIX. See
tzset
.
Extension: Gnulib offers a module ‘nstrftime’ that provides an
nstrftime
function with various GNU extensions.