timezones - List all time zones - MATLAB (original) (raw)
Main Content
Syntax
Description
timezones
returns a list of all Internet Assigned Numbers Authority (IANA) time zones accepted by the datetime
function. By default, timezones
displays the list in a separate window. For each time zone, the list includes the offset from UTC (in hours, where east is positive) and the daylight saving time shift (in hours).
timezones([area](#buv5ovz-1-area))
returns a list containing all IANA time zones in the specified geographic area.
[T](#mw%5F5066594a-3fb4-4f44-810f-71f6c6d345a1) = timezones(___)
returns the list in a table instead of a separate window.
[[T](#mw%5F5066594a-3fb4-4f44-810f-71f6c6d345a1),[vers](#mw%5F791abd3f-c3d2-4d8a-96f0-c2389a7f4526)] = timezones(___)
also returns the IANA Time Zone Database version currently used by thedatetime
data type. This version includes recent updates from the IANA. For more information, see IANA Time Zone Database.
Examples
Store all Australian time zones accepted by the datetime
function in a table.
T = timezones('Australia')
T=11×4 table Name Area UTCOffset DSTOffset _________________________ _________ _________ _________
{'Australia/Adelaide' } Australia 9.5 1
{'Australia/Brisbane' } Australia 10 0
{'Australia/Broken_Hill'} Australia 9.5 1
{'Australia/Darwin' } Australia 9.5 0
{'Australia/Eucla' } Australia 8.75 0
{'Australia/Hobart' } Australia 10 1
{'Australia/Lindeman' } Australia 10 0
{'Australia/Lord_Howe' } Australia 10.5 0.5
{'Australia/Melbourne' } Australia 10 1
{'Australia/Perth' } Australia 8 0
{'Australia/Sydney' } Australia 10 1
Sort the table by UTC offset.
ans=11×4 table Name Area UTCOffset DSTOffset _________________________ _________ _________ _________
{'Australia/Perth' } Australia 8 0
{'Australia/Eucla' } Australia 8.75 0
{'Australia/Adelaide' } Australia 9.5 1
{'Australia/Broken_Hill'} Australia 9.5 1
{'Australia/Darwin' } Australia 9.5 0
{'Australia/Brisbane' } Australia 10 0
{'Australia/Hobart' } Australia 10 1
{'Australia/Lindeman' } Australia 10 0
{'Australia/Melbourne' } Australia 10 1
{'Australia/Sydney' } Australia 10 1
{'Australia/Lord_Howe' } Australia 10.5 0.5
Input Arguments
Geographic area, specified as one of the areas in the table.
'Africa' | 'Asia' | 'Europe' |
---|---|---|
'America' | 'Atlantic' | 'Indian' |
'Antarctica' | 'Australia' | 'Pacific' |
'Arctic' | 'Etc' | 'All' |
Output Arguments
List of time zones, returned as a table.
Version History
Introduced in R2015b