Skip To Content

Create date time

The Create date time tool creates a date or date only field using existing field values.

Examples

The Create date time tool can be used in scenarios such as the following:

  • A hurricane tracking dataset contains a string representation of the observation time. Use the Create date time tool to format and output the string field as a date or date only field.
  • A dataset stores date information across the Day, Month, and Year fields. Use the Create date time tool to specify these fields and formats to create a new date only field.
  • A single field contains date values stored in varying formats. Use the Create date time tool and specify each format contained within the field.

Parameters

The following table outlines the parameters used in the Create date time tool:

ParameterDescription

Input dataset

The dataset containing the field values that will be used to create the output field.

Fields

A list of one or more fields and the format of the date or time values contained in the specified field.

Input field

A field containing date or time values.

Input format

The format of the values in the input field.

Keep source fields

Specifies whether the fields used to create the new field will be maintained in the output.

Time zone

The time zone of the input values.

Output field type

The type of field to create. The options are Date and Date only.

Output time field name

The name of the output field. This is an optional parameter. The default value is TIMESTAMP.

Usage notes

Use the Input dataset parameter to identify the dataset containing the field values that will be used to create the date or date only field. The dataset will be returned in the output with the new field added.

Use the Fields parameter to specify one or more fields to calculate the values for the output field. The output is a single date field. The following are examples of input fields and formats:

  • You have a string field named MY_DATE_TIME with a value of 2022-12-30 17:30:00. Specify MYDATETIME for the input field and a value of yyyy-MM-dd HH:mm:ss for the input format.
  • You have two fields: MY_DATE with a value of 07/25/2000 and MY_TIME with a value of 5:30:00 PM. Specify two field and format pairs. Specify the first input field as MY_DATE with a format value of MM/dd/yyyy, and the second input field as MY_TIME with a format value of hh:mm:ss a.
  • You have a string field named MY_DATE_TIME that contains dates stored in various formats. For example, 2022-12-30 17:30:00 and April 30, 2020 6:30:30 PM. To convert both values to a new date field, specify both field and format pairs as follows:
    • MY_DATE_TIME for the input field and a value of yyyy-MM-dd HH:mm:ss for the input format
    • MY_DATE_TIME for the input field and a value of MMMM dd, yyyy hh:mm:ss a for the input format
The format must exactly match the values in the specified field. For example, you cannot use a format of MM/dd/yyyy if the field contains a subset of those values such as 12/30.

By default, the fields used to create the new field will be removed from the output dataset. To maintain the input fields, enable the Keep source fields parameter.

The Time zone parameter indicates the time zone where the input time values are stored. The default value is coordinated universal time (UTC). If you specify a value other than UTC, the input values will be calculated using the specified time value, but the output field will be converted to UTC.

If the input field contains time zone offset values such as -07:00 or America/Los_Angeles, the Time zone parameter will be ignored. The time zone offset for each record value will be applied instead.

If the input field uses a milliseconds from epoch or seconds from epoch format such as 1769097663948 or 1769097703, the Time zone parameter will be ignored. Dates using these formats always use a UTC time zone.

Time zones are based on Joda-Time. To learn more about Joda-Time formats, see Joda-Time Available Time Zones.

Use the Output field name parameter to specify the name of the output field. By default, the output field is named TIMESTAMP.

Use the Output field type parameter to specify the type of field to create. The options are as follows:

  • Date—The result will be a date field containing date and time values, such as 12/31/2026, 8:00 PM. This is the default.
  • Date only—The result will be a date only field containing date values, such as 12/31/2026.

Time formats in Data Pipelines

ValueDescriptionExample

yy

The year, represented by two digits.

16

yyyy

The year, represented by four digits.

2016

MM

The month, represented numerically.

01 or 1

MMM

The month, represented using three letters.

Jan

MMMM

The month, represented using the complete spelling.

January

dd

The day.

02 or 2

HH

The hour when using a 24-hour day; values range from 0 to 23.

21

hh

The hour when using a 12-hour day; values range from 1 to 12.

9

mm

The minute; values range from 0 to 59.

45

ss

The second; values range from 0 to 59.

02

SSS

The millisecond; values range from 0 to 999.

50

a

The AM/PM marker.

PM

epoch_millis

The time in milliseconds from epoch.

1509581781000

epoch_seconds

The time in seconds from epoch.

1509747601

Z

The time zone offset expressed in hours.

-0100 or -01:00

ZZZ

The time zone offset expressed using IDs.

America/Los_Angeles

''

Single quotes add text that doesn't represent a value outlined in this table.

'T'

The following table outlines the individual values that are used to construct a full date or time format:

Outputs

The tool creates a single field. The field type and values are determined by the Output field type parameter as follows:

  • Date—The result will be a date field containing date and time values, such as 12/31/2026, 8:00 PM. This is the default.
  • Date only—The result will be a date only field containing date values, such as 12/31/2026.

The tool output includes fields from the input dataset in addition to a new date or date only field. If you did not specify an output field name, the field will be named TIMESTAMP by default.

When previewing date fields, the values will be shown in the time zone of your browser. When writing the values to a feature layer, they will be stored in UTC.

Limitations

The following are known limitations of the Create date time tool:

  • The tool returns a single new field. To calculate multiple fields, configure additional Create date time tools.
  • The format must exactly match the values in the specified field. For example, you cannot use a format of MM/dd/yyyy if the field contains a subset of those values, such as 12/30.
  • Specifying multiple formats for a single field is not supported if the field contains a mix of numeric formats and string formats. The result will be all null values. For example, this result could occur if a single field contains a value of 1590863430000 using a numeric format epoch milliseconds and a value of 12/20/2027 18:30:30 using a string format of MM/dd/yyyy HH:mm:ss, and both formats were specified as input to the tool.

Licensing requirements

The following licensing and configurations are required:

  • Creator or Professional user type
  • Publisher, Facilitator, or Administrator role, or an equivalent custom role

To learn more about Data Pipelines requirements, see Requirements.