Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to convert Military Time To Standard Time Zone

Radhika11
Tera Contributor

Hello,

How to convert 24 hours military time to 12 hours AM- PM clock in a Service Request variable.

FROM

find_real_file.png

TO

 

 04-08-2021 4:00 PM

1 ACCEPTED SOLUTION

Shailesh Bachha
Tera Expert

Hi @Radhika ,

Please try this one

System Properties >>>> Basic Configuration

find_real_file.png

Its showing AM/PM time format as follows

find_real_file.png

 

Please mark Correct and Helpful if this helps you anyway.

Regards,

Shailesh Bachhav

View solution in original post

6 REPLIES 6

Brad Bowman
Kilo Patron
Kilo Patron

The time display value of date/time fields and variables is going to use the system time format.  Users can change to a different option, such as 12 hour in their Profile, if this field is available on their view.  This is the only way to change the display value of a date/time field or variable.  If you're looking to copy the variable value to another variable and change the value in the process, that could be scripted.

Brad,

If I want to copy the date/time from one variable to the another variable and change the date/time format using scripted.  Could you please provide step by step how I would do it.  Thank you

I can work on this for you.  So that I'm replicating what you are seeing, what is your System timezone and Time format (found in System Properties -> Basic Configuration), and in your User Profile, what Time zone and Time format values do you have?  To copy this to a string field and convert the time, can this happen after the request is submitted/updated, or do you need to see it on the screen right away when the date/time variable is populated or changes?

Shailesh Bachha
Tera Expert

Hi @Radhika ,

Please try this one

System Properties >>>> Basic Configuration

find_real_file.png

Its showing AM/PM time format as follows

find_real_file.png

 

Please mark Correct and Helpful if this helps you anyway.

Regards,

Shailesh Bachhav