How to convert 12 hour date/time format to 24 hour format?

Samrudhi Pandi1
Tera Contributor

Hello all,
I need to select the time between 3:00 PM to 7:00 PM but after selecting the time in PM it is returning in AM. So is there any other way to get the correct AM/PM or the way to covert the 12hrs format to 24 hrs.?

Can anyone help me on this please?

6 REPLIES 6

Ian Mildon
Tera Guru

Internally the system runs everything on 24 hrs format in the UTC time zone. What you are seeing is the translated outputs for your instance's time settings.

The 12/24 hr settings are handled under System Properties > Basic Configuration.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Can you explain your business requirement?

System always store date/time fields in 24-hour format. It would be displayed as per user's preference

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hello,

We have a requirement to allow the users to select the time between a particular time frame.
The system's base time format is (12 hrs hh:mm: ss a).
The issue which we are facing is whenever we select the time in the date/time field in the 'PM', in the backend we are getting the Date correct but time always is in the AM.
For example. If we select the date/time on the portal as 02/06/2021 05:01:51 PM and when we try to get the date in the backend,  we are always getting AM only.
The system's time zone is in the 'US/Eastern' and the user's Time zone is also in 'US/Eastern'.
Is there any way to get the correct time format in the backend?

Thanks in advance.

Hello @Ankur Bawiskar ,

 

I've encountered an issue with the date format while updating data from the transform map. The data is sourced from a CSV file. Specifically, when I execute the transform map, it seems to convert times, such as 12:52:52, to 00:52:52.

I would greatly appreciate any suggestions you might have regarding this matter.

 

Thanks in advance