%P specifier in format_time/3 produces no output in Windows

According to SWI-Prolog -- Manual

P
Like %p but in lowercase:‘am’ or‘pm’ or a corresponding string for the current locale

Welcome to SWI-Prolog (threaded, 64 bits, version 8.3.28-30-g2e1beb082)

?- get_time(T),format_time(current_output,'%l%P',T).
 2
T = 1630464840.170424.

but lowercase p works ok (well in Windows in New Zeland it gives lowercase am/pm but that’s another story)

?- get_time(T),format_time(current_output,'%l%p',T).
 2pm
T = 1630464833.699506.

%P works correctly in Linux:

Welcome to SWI-Prolog (threaded, 64 bits, version 8.3.28)

?- get_time(T),format_time(current_output,'%l%P',T).
 3pm
T = 1630465445.4049911.

It turns out that %P is a glibc extension of the strftime() call. As it is easy enough to emulate using %p and case conversion I’ve pushed a patch that makes %P work on all platforms. Most likely there are more platform discrepancies because strftime() doesn’t seem to be very well standardized :frowning: