HOW TO
In ArcGIS Pro, it is sometimes necessary to convert the 24-hour time format, or military time string values to the 12-hour time format (AM or PM).
This article provides two workflows to convert a string field containing time data in the 24-hour format to the 12-hour format.
Use one of the workflows below to convert the 24-hour time format string values.
Use the Convert Temporal Field tool
Follow this workflow to convert the 24-hour time format string values and populate the result in a new field using the Convert Temporal Field tool.
The converted time strings are populated in the new field, 'timefield_Converted'.
Use Arcade to convert the 24-hour time format in pop-ups
Follow this workflow to display the 24-hour time format in the 12-hour time format in pop-ups without creating a new field.
// This value should be a string. // e.g. `13:00`, `22:36`, `00:45` var eventTime = $feature.<time_field_name>; var oriHours = Number(Split(eventTime, ":", 2)[0]); var minutes = Split(eventTime, ":", 2)[1]; var AMPM = When( oriHours > 12, oriHours - 12, oriHours == 0, 12, oriHours ); var suffix = When( oriHours == 24, " AM", oriHours >= 12, " PM", " AM" ); Concatenate( [ AMPM, minutes ], ":" ) + suffix;
The time is displayed in the 12-hour time format in the pop-up.
Get help from ArcGIS experts
Download the Esri Support App