1785
Views
9
Comments
Solved
How to format time as AM/PM format?
Discussion
Hi,

Any idea of how to format a time as AM/PM, 12hrs format?

Example: 23:52  should look like 11:53PM.
2021-09-06 10-27-15
João Cabaço
Solution


SyntaxEditor Code Snippet

FormatDateTime(CurrTime(),"hh:mm tt")



2021-10-17 12-36-16
Amreen Shaikh

João Cabaço wrote:


SyntaxEditor Code Snippet

FormatDateTime(CurrTime(),"hh:mm tt")




thank you . You save my day.

2012-08-01 17-33-40
Gerry

Use the Essentials component
2014-12-24 13-44-21
Keith Matthews
Using Essentials to get mm/dd/yyyy hh:mm AM

DateTime_Format(DateTimeField,"/",False)
+ " " +
TimeToAmPmText(DateTimeToTime(DateTimeField),False)
2014-07-24 23-49-07
Eduardo Cervantes
So basically you can't do this in any 8.0 version? Does 9.0 support this display format without this plugin? 
2016-04-21 20-09-55
J.
 
MVP
Check out the Text component I believe, in there there is also a format_datetime action?

2012-08-01 17-33-40
Gerry
You can do this in any version. You have to code it. If the hour is < 12 it's AM, otherwise subtract 12 from the hour and slap a PM onto it.
2014-12-24 13-44-21
Keith Matthews
... or you can use the Essentials component
2021-01-04 17-46-03
Daryl Van Johnson
The Essentials component works great. I would recommend it.
2021-09-06 10-27-15
João Cabaço
Solution


SyntaxEditor Code Snippet

FormatDateTime(CurrTime(),"hh:mm tt")



2021-10-17 12-36-16
Amreen Shaikh

João Cabaço wrote:


SyntaxEditor Code Snippet

FormatDateTime(CurrTime(),"hh:mm tt")




thank you . You save my day.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.