Work with date fields

Many feature layers store date and time (temporal) information. The date and time might represent when a feature was in a specific location or when a feature was first observed in the real world. Or the date and time might relate to other nonspatial attributes in the layer, such as when a property was sold, the last time a sample was taken from a specific water body, or the date and time a fire engine was dispatched from a specific fire station.

In ArcGIS Enterprise, you can enable time animation in maps so that the people who use your maps can see changes over time. You can also include date or date and time information in pop-ups you configure for your layer.

Temporal data is stored in date fields in hosted feature layers. To correctly add, edit, or interpret date values in hosted feature layers, it is important to understand how dates are stored and displayed. Keep the following in mind when working with date fields:

Enter dates in MM/DD/YYYY hh:mm:ss format

You can add date values to feature layers using the date and time drop-down menus in Map Viewer, Map Viewer Classic, the Data tab of the layer's item page, or an app. If you calculate a date field's values to populate the field or query the field, dates must be typed in MM/DD/YYYY hh:mm:ss format, enclosed in single quotation marks. For example, to set a date field to 5:00 PM on May 27, 2014, you would type '05/27/2014 05:00:00PM', '05/27/2014 5:00PM', or '05/27/2014 17:00:00' (24-hour clock). Storing time alone is not supported—time must always be a component of a date. If you do not provide a time, the time defaults to 12:00 a.m.

Published date fields store time in UTC

Coordinated Universal Time (abbreviated UTC) is nearly equivalent to the current time at Earth's prime meridian (zero degrees longitude), located near Greenwich, England. UTC is a more precise version of GMT (Greenwich Mean Time). When you publish feature layers containing date fields from files, ArcGIS Pro, or an ArcGIS Desktop app, specify whether the date values are in the local time zone or in UTC time. If the date fields contain local time zone information, you must specify this when you publish the layer. This enables the publishing process to transform the local time data into UTC for storage in the database. The time values will then appear correctly in your local time when you view them in the portal. However, the data is converted to and stored in UTC time in the database. Dates are converted to UTC because the physical location of the server hosting your data and the people viewing the maps that contain your data can be anywhere in the world. Storing the time in UTC allows ArcGIS Enterprise to transform the data to the correct local time zone regardless of the location of the server or the viewer of the application.

How dates are displayed

The client you use to view the data determines how date and time values are displayed. When a date field is displayed in the portal, the date is converted from UTC to your local time. This is done by querying your computer and asking it for its time zone setting. For example, suppose your computer is set to pacific standard time (PST). PST is eight hours behind UTC—when UTC is 9:00 a.m, it is 1:00 a.m. PST (or 2:00 a.m. if daylight saving time is in effect).

Inserting date and time values

When you calculate date and time values in a hosted feature layer using the SQL standard date functions, you must provide the time in UTC. When the calculated value is displayed in the table, it will show in local time. For example, if your local time is PST and you type '05/27/2014 12:23:00 PM' as a value when calculating, the value in the calculated fields will display with a time conversion based on your computer time. In this example, the calculated value will display as '05/27/20140 5:23:00 AM'.

Supported date formats in files

When you add files, such as Microsoft Excel, comma-separated values (CSV), or other delimited text files, ArcGIS Enterprise recognizes only the date formats described in the following tables.

Adding CSV and text files directly to the map is only supported in Map Viewer Classic at this time.

The following dates are supported if you publish a hosted feature layer from a CSV file:

FormatExample

M/DD/YYYY

7/28/2009

MM/DD/YYYY

07/28/2009

M/DD/YY

7/28/09

MM/DD/YY

07/28/09

YYYY/MM/DD

2009/07/28

YYYY-MM-DD

2009-07-28

YYYY/MM/DD hh:mm:ss

2009/07/28 17:23:00

YYYY/M/DD hh:mm:ss

2009/7/28 17:23:00

YYYY-MM-DD hh:mm:ss

2009-07-28 17:23:00

YYYY-M-DD hh:mm:ss

2009-7-28 17:23:00

Note:

If a field configured as a date field contains an unsupported or invalid format, the field will be created as string data type in the resulting hosted feature layer even if you change the field type before publishing.

If you add a CSV file directly to Map Viewer Classic, the following date formats are loaded as dates, but times do not appear in the table in Map Viewer Classic:

FormatExample inputTable value

M/DD/YYYY 12-hour time

7/28/2009 5:23 PM

July 28, 2009

MM/DD/YYYY 12-hour time

07/28/2009 5:23 PM

July 28, 2009

M/DD/YY 12-hour time

7/28/09 5:23 PM

July 28, 2009

MM/DD/YY 12-hour time

07/28/09 5:23 PM

July 28, 2009

If you add a CSV file directly to Map Viewer Classic, the following date formats are loaded as string fields exactly as they appear in the CSV file:

FormatExample input

M/DD/YYYY

7/28/2009

MM/DD/YYYY

07/28/2009

M/DD/YYYY 24-hour time

7/28/2009 17:23

MM/DD/YYYY 24-hour time

07/28/2009 17:23

M/DD/YY

7/28/09

MM/DD/YY

07/28/09

M/DD/YY 24-hour time

7/28/09 17:23

MM/DD/YY 24-hour time

07/28/09 17:23

Month DD

July 28

YYYY/MM

2009/07

YYYY-MM

2009-07

YYYY/MM/DD

2009/07/28

YYYY-MM-DD

2009-07-28

YYYY/MM/DD hh:mm:ss

2009/07/28 17:23:00

YYYY-MM-DD hh:mm:ss

2009-07-28 17:23:00

YYYY/MM/DD hh:mm:ss.s

2009/07/28 17:23:00.0

YYYY-MM-DD hh:mm:ss.s

2009-07-28 17:23:00.0

When you add a TXT file to Map Viewer Classic, the following date formats are recognized as date fields:

FormatExample inputTable value

M/DD/YYYY 12-hour time

7/28/2009 5:23 PM

July 28, 2009

MM/DD/YYYY 12-hour time

07/28/2009 5:23 PM

July 28, 2009

MM/DD/YY 12-hour time

07/28/09 5:23 PM

July 28, 2009

Day of week, Month DD, YYYY 12-hour time*

Tuesday, July 28, 2009 5:23 PM

July 28, 2009

Month DD, YYYY 12-hour time*

July 28, 2009 5:23 PM

July 28, 2009

*These date formats are only supported if you delimit fields using tabs or a semicolon.

Change display format of a date field

You can change how dates are displayed in the table in your portal. Tables display with the same formatting configured in pop-ups. You can change the display format of a date field by selecting the field alias in the Configure Attributes window of Pop-up Properties.