Convert Time Zone (Data Management)

License Level:BasicStandardAdvanced

Summary

Converts time values recorded in a date field from one time zone to another time zone.

Converting time values from one time zone to another helps normalize temporal data from different time zones. This improves display and query performance for visualizing temporal data from different time zones using the Time Slider.

Learn more about setting a temporal reference on your temporal data

Learn more about visualizing temporal data using the Time Slider

Illustration

Convert Time Zone illustration

Usage

Syntax

ConvertTimeZone_management (in_table, input_time_field, input_time_zone, output_time_field, output_time_zone, {input_dst}, {output_dst})
ParameterExplanationData Type
in_table

The input feature class or table that contains the time stamps which will be transformed to a different time zone.

Table View
input_time_field

The input field that contains the time stamps which will be transformed to a different time zone.

Field
input_time_zone

The input time zone in which the time stamps were collected.

String
output_time_field

The output field in which the time stamps transformed to the desired output time zone will be stored.

String
output_time_zone

The time zone to which the time stamps will be transformed. By default, the output time zone is the same as the input time zone.

String
input_dst
(Optional)

Indicates whether the time stamps were collected while observing Daylight Saving Time rules in the input time zone. When reading the time values to convert the time zone, the time values will be adjusted to account for the shift in time during Daylight Saving Time.

By default, the input time values are adjusted to account for the shift in time due to the Daylight Saving Time rules in the input time zone.

  • INPUT_ADJUSTED_FOR_DSTThe input time values are adjusted for Daylight Saving Time.
  • INPUT_NOT_ADJUSTED_FOR_DSTThe input time values are not adjusted for Daylight Saving Time.
Boolean
output_dst
(Optional)

Indicates whether the output time values will account for the shift in time due to the Daylight Saving Time rules observed in the output time zone.

By default, the output time values are adjusted to account for the shift in time due to the Daylight Saving Time rules observed in the output time zone.

  • OUTPUT_ADJUSTED_FOR_DSTThe output time values will be adjusted for Daylight Saving Time in the out time zone.
  • OUTPUT_NOT_ADJUSTED_FOR_DSTThe output time values will not be adjusted for Daylight Saving Time in the out time zone.
Boolean

Code Sample

ConvertTimeZone example (Python window)

The following Python window script demonstrates how to use the ConvertTimeZone tool in immediate mode.

import arcpy
arcpy.ConvertTimeZone_management("C:/Data/TemporalData.gdb/InputData","Input_Time","Pacific_Standard_Time","Output_Time","Eastern_Standard_Time","INPUT_ADJUSTED_FOR_DST","OUTPUT_ADJUSTED_FOR_DST")
ConvertTimeZone example (stand-alone script)

The following stand-alone script demonstrates how to use the ConvertTimeZone tool.

# Name: ConvertTimeZone_Ex02.py
# Description: Convert a time field to another time zone
# Requirements: None

# Import system modules
import arcpy

# Set local variables
inTable = "C:/Data/TemporalData.gdb/InputData"
inputTimeField = "Input_Time"
inputTimeZone = "Pacific_Standard_Time"

outputTimeField = "Output_Time"
onputTimeZone = "Eastern_Standard_Time"
inputUseDaylightSaving = "INPUT_ADJUSTED_FOR_DST"
outputUseDaylightSaving = "OUTPUT_ADJUSTED_FOR_DST"

# Execute CalculateEndDate
arcpy.ConvertTimeZone_management(inTable, inputTimeField, inputTimeZone, outputTimeField, onputTimeZone, inputUseDaylightSaving, outputUseDaylightSaving)

Environments

This tool does not use any geoprocessing environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
11/18/2013