/
286.txt
339 lines (245 loc) · 14.7 KB
/
286.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
[14] [[計算機システム]]では、[DFN[時間帯のない日時]]を扱うことがよくあり、
[DFN[浮動時]]や[[地方時]]などと呼ばれています。
[15] これは当該[[計算機]]の動作している地域で使われる[[時刻]]を表していることが多いですが、
文脈により決まるその他の地域の時刻を表していたり、
どこの時刻であるか不明であることを表していたりする場合もあります。
[16] [[将来の日時]]の記述のために敢えて用いることもあります。
[27]
人間の読み書きする[[日時の表示][日時表示]]は、
実のところほとんどが[[時差の記述]]のない[[時間帯のない日時]]です。
人間の読み書きも[[計算機]]の読み書きも、
多くの場合は文脈から[[時間帯]]を (意識的であれ無意識であれ)
補って解釈していることになります。
* 文脈
[28] [[時間帯のない日時]]は、
次のような場面で用いられます。
- [29] [[機械可読]]でない[[人間]]の読み書きが目的の[[日時表示]]
- [30] 古い[[計算機システム]]における[[日時]]
- [32] 構文上[[時間帯]]が認められていない[[日時形式]]で入出力する場合
- [31] 情報源が[[時間帯のない日時]]の場合
- [39] [[時間帯]]を明確にできない場合
[EG[
[40]
例えば[[近代的標準時]]制度の確立前の[[過去の日時]]。
]EG]
- [34] [[時差の記述]]の能力が不十分な場合
[EG[
[35] 例えば[[時差]]が[[秒]]単位であるにも関わらず、
[[分]]単位でしか記述できない場合
]EG]
- [33] 必要とされる精度に[[時差]]が重要でない場合
[EG[
[36] 例えばある出来事が起こった[[月]]を記述する場合、
月初・月末の数時間のずれを含めて明確に指定したいことは、
それほど多くありません。
]EG]
- [37]
[[時差]]によらない[[日時]]で定められる場合
[EG[
[38]
例えば[[法令]]である[[日]]が始まった瞬間と定められている場合、
[[法域]]内に[[時差]]があれば、
同じ[[日付]]の[[表示][日時表示]]でそれぞれの[[時間帯]]におけるその[[日]]の始まった瞬間を表しているかもしれません。
]EG]
- [41] [[時差]]を確定できない場合
[EG[
[42] 例えばイベントホールの予約システムで翌年の予約を扱う場合、
翌年に実施されている[[標準時]]や[[夏時刻]]が現時点で確定させられないかもしれません。
[SEE[ [[将来の日時]] ]]
]EG]
* 時間帯のないことの明記
[43]
[[日時形式]]や[[プログラミング言語]]の[[ライブラリー]]などでは、
[[時間帯のない日時]]をそうでない[[日時]]と区別するような[[構文]]の違いや[[データ型]]の違い、
[[プロパティー]]による区別が設けられていたりします。
[11] [CODE[-00:00]] も参照。
([[floating time]] とは意味が異なりますが、
[CODE[-0000]] は [[floating time]] に相当するものに使われることもあります。)
[45] [CODE[[[floating]]]]
[12] [[[CODE[DateTime]] (.NET)]] には、[[地方時]]でも [[UTC]]
でもないことを表す [DFN[[CODE[Unspecified]]]] という指定があります。
[CITE@en[DateTimeKind Enumeration (System)]] ([TIME[2017-06-01 22:21:51 +09:00]]) <https://msdn.microsoft.com/en-us/library/shx7s921(v=vs.110).aspx>
* 変換
[47]
[[プログラミング言語]]の[[ライブラリー]]などにあっては、
[[時間帯のない日時]]の[[データ型]]の値と[[時差の記述]]の組を[[時間帯]]情報のある[[日時]]に変換する手段が用意されていることがあります。
[48]
[[時間帯のない日時]]は、
暗黙裡に何らかの[[時間帯]]が仮定されて[[時間帯]]情報のある[[日時]]に[[キャスト]]されることがあります。
意図的に変換させる場合は構いませんが、
意図せず変換されてしまって[[不具合]]が生じることも多いです。
[49]
[[電子メールの日時形式]]で採用されている
[CODE[-0000]]
による記述は、
特別な対応をしていない実装が多いため、
[CODE[+0000]] すなわち [[UTC]]
と同じように解釈されることが多いです。
[46]
[CODE(HTML)@en[<input type=datetime-local>]] の
[CODE(JS)@en[Date]] への変換では、 [[UTC]] とみなされた値になります。
[50]
その他[[システム時間帯]]など「既定」の[[時間帯]]に属する[[日時]]と解釈されることも多いです。
* 浮動時
[FIG(quote)[
[FIGCAPTION[
[1] [CITE@en-US[Floating time zone support? | Communities]]
( ([TIME[2016-06-15 12:46:58 +09:00]]))
<https://discussions.apple.com/thread/1080972?start=0&tstart=0>
]FIGCAPTION]
> iCal has a handy feature where you can set the time zone of an event to "Floating". What this means is that the event is no longer tied to a specific time zone. So, let's say you want to schedule lunch at 12pm every day no matter where in the world you are, you set the time zone to floating, and that way you don't get an alert to have lunch at 4am if you're visiting another country.
]FIG]
[FIG(quote)[
[FIGCAPTION[
[2] [CITE[DateTime::TimeZone::Floating - search.cpan.org]]
( ([TIME[2016-06-15 12:47:27 +09:00]]))
<http://search.cpan.org/dist/DateTime-TimeZone/lib/DateTime/TimeZone/Floating.pm>
]FIGCAPTION]
> This class is used to provide the DateTime::TimeZone API needed by DateTime.pm, but for floating times, as defined by the RFC 2445 spec. A floating time has no time zone, and has an effective offset of zero.
]FIG]
[FIG(quote)[
[FIGCAPTION[
[3] [CITE[DateTime::TimeZone - search.cpan.org]]
( ([TIME[2016-06-15 12:48:15 +09:00]]))
<http://search.cpan.org/dist/DateTime-TimeZone/lib/DateTime/TimeZone.pm#USAGE>
]FIGCAPTION]
> If the "name" parameter is "floating", then a DateTime::TimeZone::Floating object is returned. A floating time zone does have any offset, and is always the same time. This is useful for calendaring applications, which may need to specify that a given event happens at the same local time, regardless of where it occurs. See RFC 2445 for more details.
]FIG]
[FIG(quote)[
[FIGCAPTION[
[4] [CITE@en-US[Working with Time Zones]]
( ([TIME[2011-07-05 21:14:06 +09:00]]))
<https://www.w3.org/TR/timezone/#floating>
]FIGCAPTION]
> Some observed time values are not related to a specific moment in incremental time. Instead, they need to be combined with local information to determine a range of acceptable incremental time values. We refer to these sorts of time values as "floating times" because they are not fixed to a specific incremental time value. Floating times are not attached and should never be attached to a particular time zone.
> Some examples of floating time events include a user’s birth date, a document's publication date, a list of official holidays, or the expiration date for an offer (if not tied explicitly to a time zone).
> Example 4:
> Suppose that your application delivers newspapers to users. Your application wants to show the publication date of each issue so that, for example, The Sunday News is always shown as being published on a Sunday. The publication date is thus a "floating time" value.
>
]FIG]
[FIG(quote)[
[FIGCAPTION[
[5] [CITE@en-US[Working with Time Zones]]
( ([TIME[2011-07-05 21:14:06 +09:00]]))
<https://www.w3.org/TR/timezone/#guidelinessummary>
]FIGCAPTION]
> When comparing times, floating times with no time zone information should use UTC as the time zone.
]FIG]
[FIG(quote)[
[FIGCAPTION[
[6] [CITE@en[RFC 5545 - Internet Calendaring and Scheduling Core Object Specification (iCalendar)]]
( ([TIME[2016-06-05 16:19:53 +09:00]]))
<https://tools.ietf.org/html/rfc5545#section-3.3.5>
]FIGCAPTION]
> FORM #1: DATE WITH LOCAL TIME
> The date with local time form is simply a DATE-TIME value that
> does not contain the UTC designator nor does it reference a time
> zone. For example, the following represents January 18, 1998, at
> 11 PM:
> 19980118T230000
> DATE-TIME values of this type are said to be "floating" and are
> not bound to any time zone in particular. They are used to
> represent the same hour, minute, and second value regardless of
> which time zone is currently being observed. For example, an
> event can be defined that indicates that an individual will be
> busy from 11:00 AM to 1:00 PM every day, no matter which time zone
> the person is in. In these cases, a local time can be specified.
> The recipient of an iCalendar object with a property value
> consisting of a local time, without any relative time zone
> information, SHOULD interpret the value as being fixed to whatever
> time zone the "ATTENDEE" is in at any given moment. This means
> that two "Attendees", in different time zones, receiving the same
> event definition as a floating time, may be participating in the
> event at different actual times. Floating time SHOULD only be
> used where that is the reasonable behavior.
> In most cases, a fixed time is desired. To properly communicate a
> fixed time in a property value, either UTC time or local time with
> time zone reference MUST be specified.
> The use of local time in a DATE-TIME value without the "TZID"
> property parameter is to be interpreted as floating time,
> regardless of the existence of "VTIMEZONE" calendar components in
> the iCalendar object.
]FIG]
[8] [CITE@ja['''['''perl''']'''DateTimeのtimezoneについてのメモ - $shibayu36->blog;]]
( ([TIME[2016-06-15 13:01:25 +09:00]]))
<http://blog.shibayu36.org/entry/20111002/1317542196>
[18] [CITE@en[houseabsolute/DateTime.pm: A date and time object for Perl]]
([TIME[2019-06-10 09:56:53 +09:00]])
<https://github.com/houseabsolute/DateTime.pm#floating-datetimes>
* 地方時
[44]
「地方時」や「local time」
にはいろいろな意味がありますが、
[[時間帯のない日時]]を意味していることがあります。
[SEE[ [[地方時]] ]]
[9] [CITE[time - The Go Programming Language]] ([TIME[2017-03-10 18:06:12 +09:00]]) <https://golang.org/pkg/time/#Location>
[DFN[Local]]
[10] [[T2EX]] ([TIME[2015-03-28 15:58:08 +09:00]]) <http://www.tron.org/ja/wp-content/themes/dp-magjam/pdf/specifications/ja/TEF020-S009-02.00.00_ja.pdf#page=107>
[DFN[ローカル時刻]]
[7] [CODE(HTML)@en[<input type=datetime-local>]] が扱うのも[[浮動時]]です。
[51]
[[TOMLの日時形式]]:
[[Local Date-Time]]
* 概念時刻
[24]
[DFN[概念時刻]]なる語を使う人達がいます。
通用範囲は極めて限られていて、
現時点で見つかったものは次のものだけでした。
[TIME[2019-09-30T11:41:32.300Z]]
[FIG(quote)[
[FIGCAPTION[
[21] [CITE@ja[.Net FrameworkのDateTime型 - C Sharpens you up]],
[[Sampo]],
2014-02-13
([TIME[2019-09-30 20:35:07 +09:00]])
<http://cs.hatenablog.jp/entry/2014/02/13/180213>
]FIGCAPTION]
> 絶対時刻であるUtc, Localと概念時刻であるUnspecifiedを同じクラスで扱おうとしたあたりが闇の起源くさいですね。
;; >>19 と同じ[[著者]]。
]FIG]
[FIG(quote)[
[FIGCAPTION[
[19] [CITE[timestamp with time zone型はタイムゾーン情報を持っていない - [[Qiita]]]],
@yuba,
2014年11月18日に投稿
([TIME[2019-09-30 20:29:47 +09:00]])
<https://qiita.com/yuba/items/7852a29d63d6279c6f6e>
]FIGCAPTION]
> 2015年1月1日00:00:00 という時刻表記は、地球上のどこで読んだかによって意味が変わってしまいます。このような時刻のことを [B[概念時刻]] と呼ぶことにしましょう。ボジョレー・ヌーボーの解禁時刻、11月第3木曜日00:00:00も概念時刻だからこそ世界各地で解禁時刻が違い、バブル期は日本が世界で最初に解禁されるって盛り上がったものです。
]FIG]
- [22] [CITE@ja[Sadayuki Furuhashiさんのツイート: "UNIX時刻を純粋に表現するのはInstant。LocalDateTimeは[[概念時刻]]を表すので後付けされるタイムゾーンによって表す絶対時刻が異なるやつ。OffsetDateTimeも絶対時刻を表すけども、Instantと違ってタイムゾーンを所有している… "]],
[[Sadayuki Furuhashi]],
午前11:31 · 2017年6月15日 ([TIME[2019-09-30 20:37:10 +09:00]]) <https://twitter.com/frsyuki/status/875179040809734144>
[FIG(quote)[
[FIGCAPTION[
[20] [CITE@ja[MessagePackフォーマット仕様にTimestamp型を追加 - Blog by [[Sadayuki Furuhashi]]]],
[[frsyuki]],
2017-08-10
([TIME[2019-09-30 20:31:26 +09:00]])
<http://frsyuki.hatenablog.com/entry/2017/08/10/144310>
]FIGCAPTION]
> [B[概念時刻]]は、世界のどこのタイムゾーンで扱うかによって別の瞬間を示します。例えば 2017-08-09 18:25:00 は、どのタイムゾーンで解釈するかによって実際の時刻が変わるため、概念時刻です。概念時刻は、理論上は暦(calendar system)に依存していくつかの表現方法がありますが、普通はグレゴリオ暦(西暦)を使います。
;; >>19 を参照。
]FIG]
[26] >>20 では対応する[[英語]]が「Local Time」とされています。
- [23] [CITE@ja[焼元大事件: "DBに概念時刻使わないで" - [[mikutter]]]],
[[焼元大事件]],
2018年1月18日 9:33 ([TIME[2019-09-30 20:39:05 +09:00]]) <https://social.mikutter.hachune.net/@ahiru/99368017199165758>
[25]
[[MessagePack]]
という一部で人気の[[データ形式]]仕様の作者による解説 [SRC[>>20]] で使われているので、
それなりに影響力があるのかも・・・と思いきや用例は数えるほどで特に普及してもいないようです。
説明無しではまず通用しないと思われます。
意味もわかりにくいので (「概念」とは何を指しているのか不明、
英語「local time」と対応関係にない、
対語「[[絶対時刻]]」と対応関係にない)、
使うべきではない用語だと思います。
* 関連
[52] [[時刻]]以外の不確定要素入り[[日時]]は [[floating date]] も参照。
* メモ
[13] [CITE@en[RFC 4791 - Calendaring Extensions to WebDAV (CalDAV)]]
([TIME[2017-09-24 16:22:36 +09:00]])
<https://tools.ietf.org/html/rfc4791#section-7.3>
[17] [CITE['''['''tz''']''' DST ends 2040 in Oracle database]]
([TIME[2019-01-30 07:08:42 +09:00]])
<https://mm.icann.org/pipermail/tz/2019-January/027453.html>