[SalesForce] AMPscript Format other than 24-hour/military time

I am trying to use a single DateTime field from my data extension and use a formula to split into two clauses, one for date ('l' format, working fine) and one for "hh:mm am/pm" ('hh:mm tt' format) time.

Unfortunately it appears, at least within preview and the resulting test send, that my test record which is at 10:00 PM is appearing as "22:00 PM" which is obviously not desirable. I feel like I am missing something obvious but military/24-hour time is not documented in the developer guide as far as I can see.

The email recipient is from a Lead record, and the sending user's locale is set to "English (US)".

%%=FormatDate(Object__c:Date_Time__c, "l", "", "en-US")=%%
%%=FormatDate(Object__c:Date_Time__c, "", "hh:mm tt", "en-US")=%%

and the resulting date/time:

result

I've tried h, hh, H, and HH and they all return the same format. Has anyone run into this before? Is there a format or setting I'm missing?

Best Answer

At the bottom of your link, there's something that reads "This example uses the "s" short token to format the time value 18:30 as a 12-hour clock value in the specified format:..." Have you tried that one to force the time back to 12-hour? https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/dateTimeFormatting.htm?search_text=24h

enter image description here

Related Topic