Jump to content

Date field output formatting with strftime() not outputting AM/PM


Recommended Posts

Posted

Hi everyone! I have a datefield I want to output in spanish in a lister but when I configure the time such as this:

%b %e %a %l:%M%P

I just can't get the AM/PM part of it to output ?. If i just use the dropdowns for date() formats, it works just fine. 

924356147_ScreenShot2019-05-30at1_27_32PM.png.b6ec1ea5c9137ae1a57bbcfa0d7cfb06.png

Spanish locale seems to be setup correctly because everything else language-wise works well. 

Has anyone came accros this issue?

Posted

You'll have to use lowercase "%p" and/or a workaround. The uppercase %P is missing in many platforms' native strftime implementation, and PHP just uses what the platform (i.e. the operating system) offers. So if you're e.g. on windows, a number of format characters listed in the strftime manual will throw an error or fail silently.

Posted

Just tried this with no success, now that you say so, capital letters are not working but they do fallback to the lowercase version. I'm reading that it's kind of a common issue that I'm guessing have to do with the server configuration. I'll have to take a linux dive then.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...