HOW TO

Display date fields in labels without timestamps using Arcade in ArcGIS Pro

Last Published: December 15, 2022

Summary

In ArcGIS Pro, a date field may contain both dates and timestamps. Sometimes, timestamps are not required when displaying a date field as a label. The timestamps can be removed from the date fields in the attribute table in ArcGIS Pro. However, this article provides an Arcade expression that allows displaying date fields in labels without timestamps while retaining the timestamps in the attribute table in ArcGIS Pro. In this example, the text field used in the expression is ‘Fire_Area’ while the date field used is ‘TestDate'.

Procedure

  1. Open the ArcGIS Pro project, add the layer, and create the label expression. For instructions, refer to Steps 1 through 4 in ArcGIS Pro: Writing a label expression, and select Arcade for Language.
Note: 
Ensure in the Contents pane the selected feature layer and feature class check boxes are checked to display the labels.
Feature layer and feature class check box are checked.
  1. In the Expression box, type the following Arcade expressions and replace <field_name> with the name of the fields to be displayed as labels. In the last line of the expression, ensure the field selected is the date field.
Note: 
The format of the dates can be configured as per preference. In this example, the date format used is M/D/Y.
$feature.<field_name> + " " +
Text($feature.<field_name>, 'M/D/Y')
Expression box with Arcade expression to remove timestamps from labels displaying date fields.
  1. Click the Verify button to validate the expression.
  2. Click Apply to run the script.

The image below shows labels displaying the date field without timestamps in ArcGIS Pro.

Web map displaying labels containing date fields without timestamps.

Article ID:000028827

Software:
  • ArcGIS Pro 3 0
  • ArcGIS Pro 2 8 x
  • ArcGIS Pro 2 7 x
  • ArcGIS Pro 2 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic