TimeZoneConvert

TimeZoneConvert[time,timezone]

converts the date or time object time to the specified time zone timezone.

TimeZoneConvert[time]

converts to the current $TimeZone value.

TimeZoneConvert[{time1,,timen},timezone]

converts time1 through timen to the specified timezone.

Details

  • time specifications should be a DateObject or TimeObject expression.
  • Possible timezone specifications include:
  • nnumber of hours added to GMT
    "zone"named time zone
    Entity["TimeZone", "zone"]time zone specified by the "TimeZone" entity
    loctime zone associated with the given location
    Automaticautomatically determine the time zone
    Nonespecify no time zone information
  • For numeric values n, the value represents the number of hours that must be added to Greenwich Mean Time (GMT) to obtain local time.
  • For string specifications "zone", the result will be returned in the associated named time zone.
  • Example time zone strings include "America/Chicago", "Europe/London", "Asia/Tokyo" and "Zulu".
  • A list of available time zone entities can be found using EntityList["TimeZone"].
  • For location specifications loc, the time zone associated with the specified location Entity or GeoPosition will be used.
  • TimeZoneConvert[time,Automatic] indicates that the time zone value should be determined automatically, defaulting to $TimeZone if no time zone information is otherwise available.
  • TimeZoneConvert[time,None] will return an object with TimeZoneNone.
  • TimeZoneConvert[Missing[],timezone] will return Missing[].

Examples

open allclose all

Basic Examples  (2)

Convert a DateObject from one time zone to another:

Convert a TimeObject from GMT to Eastern Time (North America):

Scope  (4)

Numeric target specifications may be an Integer, Real or Rational value:

Time zone ID strings are typically of the form "Country/City", where the offset rules are determined by local regulations and subject to change over time:

Target time zone specifications can be a "TimeZone" Entity, in addition to numeric offsets:

When a GeoPosition or location Entity is used as the target, the time zone associated with that location will be used:

Properties & Relations  (1)

For dates with a time zone value of None, the original date will remain unchanged when converted:

The reverse is also true:

Possible Issues  (1)

Some Entity expressions do not have time zone information available:

Wolfram Research (2014), TimeZoneConvert, Wolfram Language function, https://reference.wolfram.com/language/ref/TimeZoneConvert.html (updated 2022).

Text

Wolfram Research (2014), TimeZoneConvert, Wolfram Language function, https://reference.wolfram.com/language/ref/TimeZoneConvert.html (updated 2022).

CMS

Wolfram Language. 2014. "TimeZoneConvert." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/TimeZoneConvert.html.

APA

Wolfram Language. (2014). TimeZoneConvert. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TimeZoneConvert.html

BibTeX

@misc{reference.wolfram_2023_timezoneconvert, author="Wolfram Research", title="{TimeZoneConvert}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/TimeZoneConvert.html}", note=[Accessed: 18-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_timezoneconvert, organization={Wolfram Research}, title={TimeZoneConvert}, year={2022}, url={https://reference.wolfram.com/language/ref/TimeZoneConvert.html}, note=[Accessed: 18-March-2024 ]}