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.