/
125.txt
141 lines (90 loc) · 5.13 KB
/
125.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
[4] [[西暦]]が2桁または3桁の[[数字]]列で表されている場合、
これをどう解釈するかが問題となります ([DFN[2000年問題]])。
各種の[[プロトコル]]や[[プログラム]]は色々な方針を採っています。
[14] [TIME[2000年][year:2000]]は過ぎましたが、2桁で[[年]]が表わされる場面は残っており、
今後も無くなることはありませんから、これをどう解釈するか、何らかの判断は必要です。
* 判断する時点の日付を元に判断
** RFC 2068, RFC 2616 (HTTP/1.1)
19.3 曰く:
> HTTP/1.1 clients and caches should assume that an RFC-850
> date which appears to be more than 50 years in the future
> is in fact in the past (this helps solve the "year 2000" problem).
HTTP/1.1 クライアントとキャッシュは、50年以上未来の RFC 850
日付を、実際は過去のものと解釈するべきです (これが「2000年」問題解決の
手助けとなります)。
[6] [[RFC 7231]] もこれを踏襲しています。
[REFS[
- [7] [CITE@en[RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content]] ([TIME[2014-08-07 05:54:02 +09:00]] 版) <https://tools.ietf.org/html/rfc7231#section-7.1.1.1>
]REFS]
;; [11] [[HTTPの日時形式]]を参照。
** [CODE(perl)@en[Time::Local]]
[10] [[Perlモジュール]] [CODE(perl)@en[[[Time::Local]]]] は現在から前後50年以内と解釈します
[SRC[>>9]]。
[REFS[
- [9] [CITE[Time::Local - search.cpan.org]] ([TIME[2014-10-06 04:02:21 +09:00]] 版) <http://search.cpan.org/dist/Time-Local/lib/Time/Local.pm#Year_Value_Interpretation>
]REFS]
* 29-30を境界とする
** Microsoft Windows
00〜29 → +2000, 30〜99 → +1900
Windoze 98 以降では、[[コントロールパネル]]の「地域」で変更出来ます。
<http://www.microsoft.com/japan/year2k/2kwhitepaper/settings_jp.htm>
* 49-50 を境界とする
** RFC 2822
RFC 2822 4.3 曰く:
> Where a two or three digit year occurs in a date, the year is to be
> interpreted as follows: If a two digit year is encountered whose
> value is between 00 and 49, the year is interpreted by adding 2000,
> ending up with a value between 2000 and 2049. If a two digit year is
> encountered with a value between 50 and 99, or any three digit year
> is encountered, the year is interpreted by adding 1900.
日付内で2桁や3桁の年が出てきたら、年は次のように解釈します。
2桁年号が00〜49の値の場合、2000を加えて2000〜2049の値と解釈します。
2桁年号が50〜99の値の場合、または3桁の年号の場合は、
1900を加えて解釈します。
** S/MIME
[3]
[[S/MIME]] の [CODE[[[UTCTime]]]] は 49‐50 が境界です
[SRC[RFC 3851 2.5.1]]。
** JIS X 0603:2000
[[JISX0603]]:2000
『情報交換用フレキシブルディスクカートリッジのラベル及びファイル構成』
8.5.15, 8.5.20 では、2桁年号で00〜49に+2000, 50〜99に+1900して
解釈します。ただし、2050年以降は使ってはいけません。
** PKIX
[FIG(quote)[
[FIGCAPTION[
[12] [CITE@en[RFC 5280 - Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile]]
([TIME[2015-02-22 15:44:10 +09:00]] 版)
<http://tools.ietf.org/html/rfc5280#section-4.1.2.5.1>
]FIGCAPTION]
> Conforming
systems MUST interpret the year field (YY) as follows:
> Where YY is greater than or equal to 50, the year SHALL be
interpreted as 19YY; and
> Where YY is less than 50, the year SHALL be interpreted as 20YY.
]FIG]
* 68-69を境界とする
** X/Open の推奨
00〜68 → +2000, 69〜99 → +1900 を推奨しているらしいです。
* 69-70 を境界とする
[5] [[RFC 6265]] が規定する[[Cookieの日付形式]]の構文解析手続きにおいては、
69以下は2000年代、70以上は1900年代とされています。
[REFS[
- [15] [CITE@en[MySQL :: MySQL 8.0 Reference Manual :: 12.3.3 The YEAR Type]] ([TIME[2017-03-10 16:49:06 +09:00]]) <https://dev.mysql.com/doc/refman/8.0/en/year.html>
- [16] [CITE@en[MySQL :: MySQL 8.0 Reference Manual :: 12.3.8 Two-Digit Years in Dates]] ([TIME[2017-03-10 16:50:50 +09:00]]) <https://dev.mysql.com/doc/refman/8.0/en/two-digit-years.html>
]REFS]
* 38-39を境界とする
38年を境に、39年以降が1900年代にする実装が少なからずあります。
(一部の [[M$]] 製品を含みます。)
根拠はよく分かりません。 ([[Un*x時間]]の32ビット限界の関係?)
* すべて1900年代とする
[17] [CODE[XPath and XQuery Functions and Operators]] の [CODE[fn:parse-ietf-date]]
が採用しています。
* メモ
[13] RFC 2626 <urn:ietf:rfc:2626> は、それ以前に発行された
RFC の仕様に存在する2000年問題を検証しています。
[REFS[
- [8] <http://www.funaba.org/en/programming-and-calendar.html>
]REFS]
[1] [[Lotus Organizer]] 2000 は、利用者の入力を80年前〜19年後までの範囲内として受け取ります。
[2] [[Lotus 1-2-3]] 98 は、 >>1 の方法と「全部1900年代」を選べました。