Convert Temporal Field (Data Management Tools)
Summary
Transfers temporal values stored in a field to another field. The tool can be used to convert between field types (text, numeric, or datetime fields) or to convert the values to a different format such as dd/MM/yy HH:mm:ss to yyyy-MM-dd.
Usage
Caution:
This tool modifies the input data. See Tools that modify or update the input data for more information and strategies to avoid undesired data changes.
If the input time field is a text or numeric field, choose or specify the appropriate format for the Input Format parameter.
If the Input Field parameter value is a text field, custom formats can be added to the Input Format parameter.
For text fields that are compliant with ISO-8601 formatting, use yyyy-MM-ddTHH:mm:ss.s as the input format. This format can handle inputs that use either a UTC designator (Z) or UTC offsets (±hh:mm).
Learn more about converting string time values to date format
Outputs to a text field with yyyy-MM-ddTHH:mm:ss.s format do not support the addition of a UTC (Z) or UTC offset (±hh:mm) designator.
If the Time Zone environment is specified, the environment value's for the Time Zone Offset parameter will be used by default, unless the parameter value is also specified.
If the Input Field parameter value is a Date field and the Output Field Type parameter value is Timestamp offset, you can specify the String type for the Time Zone Offset parameter and choose a time zone that will be uniformly applied to all rows in the output. For example, selecting Pacific Standard Time as an offset for an input date field with a value 2002-08-20 12:00:00 PM will produce an output value of 2002-08-20 12:00:00 PM -08:00. All other rows in the input Date field will also have the -08:00 offset applied.
Alternatively, specify the Field type, and select a field containing the time zone offset data. Field values can be numeric, such as -5, or string, such as Eastern Standard Time. See the Time Zone Offset parameter for a list of all time zones supported as string values. When a field is specified, the tool will use the row value as the offset value. Using a field for the offset can be useful when the date values for the input rows are from different time zones. For example, if the input Date field contains the values 2001-01-01 7:00:00 AM, 2001-01-02, 9:00:00 AM, and 2001-01-02 12:00:00 PM, and the offset field contains the values -8, -5, and 0 for the corresponding rows, the tool will output the values 2001-01-01 7:00:00 AM -08:00, 2001-01-02 9:00:00 AM -05:00, and 2001-01-02 12:00:00 PM +00:00.
Note:
The tool will not perform any time or date conversion when the Input Field parameter value is a Date field and the Output Field Type parameter value is Timestamp offset. If a time or date conversion needs to occur, use the Convert Time Zone tool to convert the date field to the appropriate date and time before using this tool to apply the corresponding timestamp offset value.
If the Input Field parameter value is a Timestamp Offset field and the Output Field Type parameter value is a Date, Date Only, or Time Only field, the tool will perform the appropriate time and date conversion to the specified Time Zone Offset parameter value. For example, a Timestamp Offset field value of 2011-06-02 4:30:00.000 PM -08:00 converted to Date type, with the Time Zone Offset parameter set to the String type and a value of UTC will have an output value of 2011-06-03 12:30:00 AM.
The Output Format parameter can be specified as Time only, but Time Only is not an accepted Input Format parameter value. This is because the Time only output format lacks sufficient information to be converted to other formats such as Timestamp Offset, Date, or Date Only.
Parameters
| Label | Explanation | Data type |
|---|---|---|
|
Input Table |
The layer or table that contains the field containing the time values that will be converted. |
Table View |
|
Input Field |
The field containing the time values. The field can be of type short, long, float, double, text, date, timestamp offset, or date only. |
Field |
|
Input Format (Optional) |
The format of the time values in the Input Field parameter value. You can choose a standard time format from the drop-down list or specify a custom format. The parameter is not supported when the input time field is of type date. Note:The format strings are case sensitive.
|
String |
|
Output Field Name |
The name of the field to be added in which the converted time values will be stored. |
String |
|
Output Field Type (Optional) |
Specifies the field type of the output time field.
|
String |
|
Output Format (Optional) |
The format of the output time values. Supported output time formats depend on the Output Field Type parameter value. A custom format can also be used to convert the value to a different format or to extract a portion of the value (such as the year). For a list of custom formats, see the Input Format parameter explanation. This parameter is not used when the Output Field Type parameter value is Date. Note:If the data type of the output time field isn't long enough to store the converted time value, the output value will be truncated. |
String |
|
Time Zone Offset (Optional) |
The time zone or field containing a numeric offset from the input table that will be used as the output time zone. If the Time Zone environment is specified, the tool will use the that environment value by default.
|
String; Field |
Derived output
| Label | Explanation | Data type |
|---|---|---|
|
Updated Input Table |
The updated input table. |
Table View |
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes