PHP 对
Africa/Freetown
时区的定义是怎么回事?从 1941 年开始,每年 12 月 31 日变为 XXX UTC+00:40
,然后立即(同一秒)变回 LMT UTC-00:53
(当地时间)。我尝试搜索 UTC-00:53
的时区和 Africa/Freetown
的时区,但我什至找不到任何提及它的内容,更不用说解释它了。弗里敦似乎是整个塞拉利昂的时区 (UTC+00:00
)。 Africa/Freetown
似乎也不是规范时区。它是否被错误地包含在规范时区中?
- ts: -9223372036854775808
time: "-292277022657-01-27T08:29:52+0000"
offset: -3180
isdst: false
abbr: LMT
- ts: -2776979220
time: "1882-01-01T00:53:00+0000"
offset: -3180
isdst: false
abbr: FMT
- ts: -1783120020
time: "1913-07-01T00:53:00+0000"
offset: -3600
isdst: false
abbr: "-01"
- ts: -1170284400
time: "1932-12-01T01:00:00+0000"
offset: -2400
isdst: true
abbr: "-0040"
- ts: -1159831200
time: "1933-04-01T00:40:00+0000"
offset: -3600
isdst: false
abbr: "-01"
- ts: -1146610800
time: "1933-09-01T01:00:00+0000"
offset: -2400
isdst: true
abbr: "-0040"
- ts: -1128295200
time: "1934-04-01T00:40:00+0000"
offset: -3600
isdst: false
abbr: "-01"
- ...
- ts: -957308400
time: "1939-09-01T01:00:00+0000"
offset: -2400
isdst: true
abbr: "-0040"
- ts: -956964000
time: "1939-09-05T00:40:00+0000"
offset: -3600
isdst: false
abbr: "-01"
- ts: -885769200
time: "1941-12-07T01:00:00+0000"
offset: 1200
isdst: true
abbr: "+01"
- ts: -883615200
time: "1941-12-31T23:20:00+0000"
offset: 2400
isdst: false
abbr: XXX
- ts: -883615200
time: "1941-12-31T23:20:00+0000"
offset: -3180
isdst: false
abbr: LMT
- ts: -852079200
time: "1942-12-31T23:20:00+0000"
offset: 2400
isdst: false
abbr: XXX
- ts: -852079200
time: "1942-12-31T23:20:00+0000"
offset: -3180
isdst: false
abbr: LMT
- ...
- ts: 2145914400
time: "2037-12-31T23:20:00+0000"
offset: 2400
isdst: false
abbr: XXX
- ts: 2145914400
time: "2037-12-31T23:20:00+0000"
offset: -3180
isdst: false
abbr: LMT
$timezone = new DateTimeZone('Africa/Freetown');
var_dump($timezone->getTransitions());
array(214) {
[0]=>
array(5) {
["ts"]=>
int(-9223372036854775808)
["time"]=>
string(33) "-292277022657-01-27T08:29:52+0000"
["offset"]=>
int(-3180)
["isdst"]=>
bool(false)
["abbr"]=>
string(3) "LMT"
}
[1]=>
array(5) {
["ts"]=>
int(-2776979220)
["time"]=>
string(24) "1882-01-01T00:53:00+0000"
["offset"]=>
int(-3180)
["isdst"]=>
bool(false)
["abbr"]=>
string(3) "FMT"
}
[2]=>
array(5) {
["ts"]=>
int(-1783120020)
["time"]=>
string(24) "1913-07-01T00:53:00+0000"
["offset"]=>
int(-3600)
["isdst"]=>
bool(false)
["abbr"]=>
string(3) "-01"
}
[3]=>
array(5) {
["ts"]=>
int(-1170284400)
["time"]=>
string(24) "1932-12-01T01:00:00+0000"
["offset"]=>
int(-2400)
["isdst"]=>
bool(true)
["abbr"]=>
string(5) "-0040"
}
[4]=>
array(5) {
["ts"]=>
int(-1159831200)
["time"]=>
string(24) "1933-04-01T00:40:00+0000"
["offset"]=>
int(-3600)
["isdst"]=>
bool(false)
["abbr"]=>
string(3) "-01"
}
[5]=>
array(5) {
["ts"]=>
int(-1146610800)
["time"]=>
string(24) "1933-09-01T01:00:00+0000"
["offset"]=>
int(-2400)
["isdst"]=>
bool(true)
["abbr"]=>
string(5) "-0040"
}
[6]=>
array(5) {
["ts"]=>
int(-1128295200)
["time"]=>
string(24) "1934-04-01T00:40:00+0000"
["offset"]=>
int(-3600)
["isdst"]=>
bool(false)
["abbr"]=>
string(3) "-01"
}
.
.
.
[17]=>
array(5) {
["ts"]=>
int(-957308400)
["time"]=>
string(24) "1939-09-01T01:00:00+0000"
["offset"]=>
int(-2400)
["isdst"]=>
bool(true)
["abbr"]=>
string(5) "-0040"
}
[18]=>
array(5) {
["ts"]=>
int(-956964000)
["time"]=>
string(24) "1939-09-05T00:40:00+0000"
["offset"]=>
int(-3600)
["isdst"]=>
bool(false)
["abbr"]=>
string(3) "-01"
}
[19]=>
array(5) {
["ts"]=>
int(-885769200)
["time"]=>
string(24) "1941-12-07T01:00:00+0000"
["offset"]=>
int(1200)
["isdst"]=>
bool(true)
["abbr"]=>
string(3) "+01"
}
[20]=>
array(5) {
["ts"]=>
int(-883615200)
["time"]=>
string(24) "1941-12-31T23:20:00+0000"
["offset"]=>
int(2400)
["isdst"]=>
bool(false)
["abbr"]=>
string(3) "XXX"
}
[21]=>
array(5) {
["ts"]=>
int(-883615200)
["time"]=>
string(24) "1941-12-31T23:20:00+0000"
["offset"]=>
int(-3180)
["isdst"]=>
bool(false)
["abbr"]=>
string(3) "LMT"
}
[22]=>
array(5) {
["ts"]=>
int(-852079200)
["time"]=>
string(24) "1942-12-31T23:20:00+0000"
["offset"]=>
int(2400)
["isdst"]=>
bool(false)
["abbr"]=>
string(3) "XXX"
}
[23]=>
array(5) {
["ts"]=>
int(-852079200)
["time"]=>
string(24) "1942-12-31T23:20:00+0000"
["offset"]=>
int(-3180)
["isdst"]=>
bool(false)
["abbr"]=>
string(3) "LMT"
}
.
.
.
[212]=>
array(5) {
["ts"]=>
int(2145914400)
["time"]=>
string(24) "2037-12-31T23:20:00+0000"
["offset"]=>
int(2400)
["isdst"]=>
bool(false)
["abbr"]=>
string(3) "XXX"
}
[213]=>
array(5) {
["ts"]=>
int(2145914400)
["time"]=>
string(24) "2037-12-31T23:20:00+0000"
["offset"]=>
int(-3180)
["isdst"]=>
bool(false)
["abbr"]=>
string(3) "LMT"
}
}
答案可以在IANA时区数据中找到。在文件
backzone
中,说明了以下内容:
# Sierra Leone
# From P Chan (2020-12-09):
# Standard time of GMT-1 was adopted on 1913-07-01. Twenty minutes of DST was
# introduce[d] in 1932 and was suspended in 1939. In 1941, GMT was adopted by
# Defence Regulations. This was made permanent in 1946.
#
# Government Notice No. 121 of 1913, 1913-06-06, Sierra Leone Royal Gazette,
# Vol. XLIV, No. 1384, 1913-06-14, p 347
# Alteration of Time Ordinance, 1932 (No. 34 of 1932) [1932-12-01]
# Alteration of Time (Amendment) Ordinance, 1938 (No. 25 of 1938) [1938-11-24]
# Defence Regulations (No. 9), 1939 (Regulations No. 9 of 1939), 1939-09-05
# Defence Regulations (No. 11), 1939 (Regulations No. 11 of 1939), 1939-09-27
# Defence (Amendment) (No. 17) Regulations, 1941 (Public Notice No. 157 of
# 1941), 1914-12-04
# Alteration of Time (Amendment) Ordinance, 1946 (No. 2 of 1946) [1946-02-07]
# From Tim Parenti (2021-03-02), per P Chan (2021-02-25):
# For Sierra Leone in 1957-1962, the standard time was defined in the
# Alteration of Time Ordinance, 1932 (as amended in 1946, renamed to Local Time
# Ordinance in 1960 and Local Time Act in 1961). It was unamended throughout
# that period. See references to "Time" in the Alphabetical Index of the
# Legislation in force on the 31st day of December,
# 1957: https://books.google.com/books?id=lvQ-AQAAIAAJ&pg=RA2-PA49
# 1958: https://books.google.com/books?id=4fQ-AQAAIAAJ&pg=RA2-PA50
# 1959: https://books.google.com/books?id=p_U-AQAAIAAJ&pg=RA2-PA55
# 1960: https://books.google.com/books?id=JPY-AQAAIAAJ&pg=RA3-PA37
# 1961: https://books.google.com/books?id=7vY-AQAAIAAJ&pg=RA3-PA41
# 1962: https://books.google.com/books?id=W_c-AQAAIAAJ&pg=RA3-PA44
# 1963: https://books.google.com/books?id=9vk-AQAAIAAJ&pg=RA1-PA47
#
# Although Shanks & Pottenger had DST from Jun 1 00:00 to Sep 1 00:00 in this
# period, many contemporaneous almanacs agree that it wasn't used:
# https://mm.icann.org/pipermail/tz/2021-February/029866.html
# Go with the above.
Rule SL 1932 only - Dec 1 0:00 0:20 -0040
Rule SL 1933 1938 - Mar 31 24:00 0 -01
Rule SL 1933 1939 - Aug 31 24:00 0:20 -0040
Rule SL 1939 only - May 31 24:00 0 -01
Zone Africa/Freetown -0:53:00 - LMT 1882
-0:53:00 - FMT 1913 Jul 1 # Freetown MT
-1:00 SL %s 1939 Sep 5
-1:00 - -01 1941 Dec 6 24:00
0:00 - GMT
该文件充满了其他调整,旨在尝试反映某些时区的历史怪异现象。
请注意,PHP 的解释本身仍然可能存在奇怪之处,尤其是像这样深奥的东西。