Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions lib/Time/Zone.pm
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,12 @@ CONFIG: {
"fst" => +2*3600, # French Summer
"eest" => +3*3600, # Eastern European Summer
"msd" => +4*3600, # Moscow Daylight (historical; Russia abolished DST permanently in Oct 2014)
"west" => +1*3600, # Western European Summer
"irdt" => +4*3600+1800,# Iran Daylight
"wadt" => +8*3600, # West Australian Daylight
"awdt" => +9*3600, # Australian Western Daylight
"kdt" => +10*3600, # Korean Daylight
# "cadt" => +10*3600+1800, # Central Australian Daylight
"acdt" => +10*3600+1800,# Australian Central Daylight
"aedt" => +11*3600, # Eastern Australian Daylight
"eadt" => +11*3600, # Eastern Australian Daylight
"nzd" => +13*3600, # New Zealand Daylight
Expand Down Expand Up @@ -252,13 +255,19 @@ CONFIG: {
"swt" => +1*3600, # Swedish Winter
"set" => +1*3600, # Seychelles
"fwt" => +1*3600, # French Winter
"sast" => +2*3600, # South African Standard
"eet" => +2*3600, # Eastern Europe, USSR Zone 1
"ukr" => +2*3600, # Ukraine
"bt" => +3*3600, # Baghdad, USSR Zone 2
"eat" => +3*3600, # East Africa
"msk" => +3*3600, # Moscow (UTC+3; was UTC+4 in 2011-2014 when Russia used permanent DST, reverted Oct 2014)
# "it" => +3*3600+1800,# Iran
"trt" => +3*3600, # Turkey
"irst" => +3*3600+1800,# Iran Standard
"aft" => +4*3600+1800,# Afghanistan
"zp4" => +4*3600, # USSR Zone 3
"pkt" => +5*3600, # Pakistan Standard
"zp5" => +5*3600, # USSR Zone 4
"npt" => +5*3600+2700,# Nepal (+5:45)
"ist" => +5*3600+1800,# Indian Standard
"zp6" => +6*3600, # USSR Zone 5
# For completeness. NST is also Newfoundland Stanard, and SST is also Swedish Summer.
Expand All @@ -267,12 +276,13 @@ CONFIG: {
"ict" => +7*3600, # Indochina Time
# "jt" => +7*3600+1800,# Java (3pm in Cronusland!)
"wst" => +8*3600, # West Australian Standard
"awst" => +8*3600, # Australian Western Standard
"pht" => +8*3600, # Philippine Time
"hkt" => +8*3600, # Hong Kong
"cct" => +8*3600, # China Coast, USSR Zone 7
"jst" => +9*3600, # Japan Standard, USSR Zone 8
"kst" => +9*3600, # Korean Standard
# "cast" => +9*3600+1800,# Central Australian Standard
"acst" => +9*3600+1800,# Australian Central Standard
"aest" => +10*3600, # Eastern Australian Standard
"east" => +10*3600, # Eastern Australian Standard
"gst" => +10*3600, # Guam Standard, USSR Zone 9
Expand Down
23 changes: 23 additions & 0 deletions t/zone.t
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,29 @@ is(tz_offset("PHT"), 28800, "tz_offset PHT = 28800 (Philippine Time, UTC+8)");
is(tz_offset("ict"), 25200, "tz_offset ict case insensitive");
is(tz_offset("pht"), 28800, "tz_offset pht case insensitive");

# tz_offset: Australian timezone abbreviations
is(tz_offset("ACST"), 34200, "tz_offset ACST = 34200 (Australian Central Standard, UTC+9:30)");
is(tz_offset("ACDT"), 37800, "tz_offset ACDT = 37800 (Australian Central Daylight, UTC+10:30)");
is(tz_offset("AEST"), 36000, "tz_offset AEST = 36000 (Australian Eastern Standard, UTC+10)");
is(tz_offset("AEDT"), 39600, "tz_offset AEDT = 39600 (Australian Eastern Daylight, UTC+11)");
is(tz_offset("AWST"), 28800, "tz_offset AWST = 28800 (Australian Western Standard, UTC+8)");
is(tz_offset("AWDT"), 32400, "tz_offset AWDT = 32400 (Australian Western Daylight, UTC+9)");

# tz_offset: African timezone abbreviations
is(tz_offset("SAST"), 7200, "tz_offset SAST = 7200 (South African Standard, UTC+2)");
is(tz_offset("EAT"), 10800, "tz_offset EAT = 10800 (East Africa, UTC+3)");

# tz_offset: Middle East and South Asian timezone abbreviations
is(tz_offset("TRT"), 10800, "tz_offset TRT = 10800 (Turkey, UTC+3)");
is(tz_offset("IRST"), 12600, "tz_offset IRST = 12600 (Iran Standard, UTC+3:30)");
is(tz_offset("IRDT"), 16200, "tz_offset IRDT = 16200 (Iran Daylight, UTC+4:30)");
is(tz_offset("AFT"), 16200, "tz_offset AFT = 16200 (Afghanistan, UTC+4:30)");
is(tz_offset("PKT"), 18000, "tz_offset PKT = 18000 (Pakistan Standard, UTC+5)");
is(tz_offset("NPT"), 20700, "tz_offset NPT = 20700 (Nepal, UTC+5:45)");

# tz_offset: European DST abbreviations
is(tz_offset("WEST"), 3600, "tz_offset WEST = 3600 (Western European Summer, UTC+1)");

# tz_offset: unknown zone returns undef
is(tz_offset("BOGUS"), undef, "tz_offset unknown zone returns undef");

Expand Down
Loading