TimeZoneOffset
TimeZoneOffset[tz]
gives the numeric offset between the time zone tz and GMT on the current date.
TimeZoneOffset[loc]
gives the numeric offset between the time zone for the location loc and GMT.
TimeZoneOffset[tz,base]
gives the numeric offset between tz and the specified base time zone.
TimeZoneOffset[tz,date]
gets a list of possible time zone offsets for tz at the given date list.
TimeZoneOffset[tz,base,date]
gives the numeric offset between tz and base on the specified date.
Details
- TimeZoneOffset[] gives the offset of your current $TimeZone relative to GMT on the current date.
- Time zone specifications tz can be an Integer, Real, time zone String, Entity, or GeoPosition.
- Date specifications date can be a DateObject, TimeObject, DateList, AbsoluteTime, or DateString.
- TimeZoneOffset accounts for daylight saving time and returns the numeric offset for the specified time zone on a given date.
- A list of available time zone entities can be found using EntityList["TimeZone"].
Examples
open allclose allBasic Examples (4)
Find the numeric offset for a time zone on the current date:
Get the offset for the time zone corresponding to a location:
Location specifications can also be entities:
Compare the offset between the time in New York and the time in London on different dates:
The offset between two time zones can vary depending on daylight saving time:
Get a list of possible time zone offsets at a given date list for a local time:
During a transition off daylight time, some local times will have two possible offsets:
The transition onto daylight time skips an hour of local time:
Scope (1)
EntityList["TimeZone"] can be used to find available "TimeZone" entities:
Properties & Relations (1)
TimeZoneOffset gives the difference between time zones:
For a time zone value of None, the offset to any other time zone will always be zero:
Text
Wolfram Research (2015), TimeZoneOffset, Wolfram Language function, https://reference.wolfram.com/language/ref/TimeZoneOffset.html (updated 2021).
CMS
Wolfram Language. 2015. "TimeZoneOffset." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/TimeZoneOffset.html.
APA
Wolfram Language. (2015). TimeZoneOffset. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TimeZoneOffset.html