Select to view content in your preferred language

Date/Time Labels in ArcGIS Online - adding AM or PM for labels

442
2
Jump to solution
10-29-2023 01:55 AM
Labels (1)
karyn_rosa123
New Contributor III

Hi,

I would like to format my date/time labels in ArcGIS Online for a map but I can't seem to get the date/time field to display with an AM or PM afterwards.

I would like my field called assessment_date to display labels like this: 29 Oct 2023 - 8.35 AM

The following Arcade statement in my label expression does work but it doesn't show the AM or PM:

Text($feature["assessment_date"], 'DD MMM YYYY - h:mm') 

I have tried Text($feature["assessment_date"], 'DD MMM YYYY - h:mm tt') thinking this would add the AM PM but it just displays as 29 Oct 2023 - 8.35 tt

Any ideas?

Thanks very much,

0 Kudos
1 Solution

Accepted Solutions
RussRoberts
Esri Notable Contributor

Alter your expression to this

Text($feature["Date_Time"], "DD/MM/Y h:mm A")
 
RussRoberts_0-1698582937198.png

 

View solution in original post

2 Replies
RussRoberts
Esri Notable Contributor

Alter your expression to this

Text($feature["Date_Time"], "DD/MM/Y h:mm A")
 
RussRoberts_0-1698582937198.png

 

karyn_rosa123
New Contributor III

Thanks very much Russ! That works perfectly. 

 

It would be great if that could be added to the online help files (if not already there).  I couldn't see any reference to it in:  https://doc.arcgis.com/en/arcgis-online/manage-data/work-with-date-fields.htm but it is referred to in the ArcGIS Online Dashboards documentation I see now.  

0 Kudos