-
Notifications
You must be signed in to change notification settings - Fork 4
/
208.txt
887 lines (659 loc) · 47.8 KB
/
208.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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
[6] [DFN[[[ISO 8601]]]] は、[[日付]]と[[時刻]]の表現形式に関する [[ISO]] [[国際標準]]です。
[[日時]]の[[情報交換]]に使えるいくつかの構文を定義しています。
[EG[
[182] 例えば[[グレゴリオ暦]]の[[西暦]]2016年3月25日を [CODE[2016-03-25]]
と表現する、といったことが規定されています。
]EG]
[168] [[ISO 8601]] は、[[日時]]に関する様々な対象を記述したり、様々な応用分野で利用したりできるように、
多くの選択肢のある“緩い”仕様を提示しています。実際には、利用する場面ごとにより具体的な仕様を
([[情報交換の当事者間の合意]]により) 確定する必要があり、それを[[プロファイル]]と呼ぶことがあります。
[[ISO 8601]] の[[プロファイル]]は、色々な場面で使われています。
[175] [[自然言語]]文では、歴史と文化により様々な日時表現が用いられています。
しかし日米欧で年月日の順序が異なるなど、その表記の揺れは大きく、
[[相互運用可能]]な[[情報交換]]のためには何らかの基準が必要です。
[[ISO 8601]] はそのような基準として色々な場面で採用されています。
;; [176] しかし、いつでもどこでもむやみに [[ISO 8601]] の日時形式を採用するべきとも言えません。
例えば [[ISO 8601]] の規定に従えば日付と時刻の間には「T」と記載することになります
(例えば2016年3月25日の12時18分は [CODE[2016-03-25T12:18]] と表記します。) が、
[[人間]]が対象読者なら、この表記は一般的ではありませんから、奇妙に思われるでしょう。
* 仕様書
[REFS[
- [7] '''[[ISO 8601]]'''
-- [38] [CITE@en[Home]]
([TIME[2013-12-10 08:40:33 +09:00]] 版))
<http://www.iso.org/iso/iso8601>
- [27] [[JIS X 0301]]: ISO 8601 に対応 ([[MOD]]) する [[JIS]]
]REFS]
[37] [[ISO 8601]] は >>38 から入手できますが、有料です。
** 表記法
[45] [[ISO 8601]] では[[地の文]]と[[日時表現]]や[[日時書式表現]]を区別するために、
[RUBYB[表現]@en[representation]]を「[」と「]」で括っています。この括弧は仕様書の表現上のもので、
表現の一部ではないとされています。 [SRC[>>7 Introduction]]
* 表現
[126] [[ISO 8601]] は日時などを記述した文字列のことを[RUBYB[表現]@en[representation]]と呼んでいます。
[[ISO 8601]] では次のような表現が定義されています。
[FIG[
- [[日時表現]]
-- 日付の表現
-- 時刻の表現
-- 時差の表現
-- 日時の表現
-- 時間長の表現
-- 時間間隔の表現
-- 反復時間間隔の表現
- [[日時書式表現]]
]FIG]
[26] [DFN[[RUBYB[[[日時表現]]]@en[date and time representation]]]]は、
[[時間点]]や[[時間間隔]]、[[反復時間間隔]]を示す[RUBYB[表現]@en[representation]]です [SRC[>>7 2.3.1]]。
[36] [[日時表現]]は精度や値域によって次のように分類されています。
[FIG[
- [32] [DFN[[RUBYB[[[完全表現]]]@en[complete representation]]]]は、
当該表現を構成するすべての日時の要素を含めた表現です。 [SRC[>>7 2.3.5]]
-- 要素としてはすべて含まれますが、5桁以上の年や小数部は含まれません。
- [33] [DFN[[RUBYB[[[小数付き表現]]]@en[decimal representation]]]]は、
構成する下位の部品に[[小数]]を加えたものです。 [SRC[>>7 2.3.6]]
- [34] [DFN[[RUBYB[[[精度を削減した表現]]]@en[representation with reduced accuracy]]]]は、
下位の部品を省略したものです。 [SRC[>>7 2.3.7]]
- [35] [DFN[[RUBYB[[[展開表現]]]@en[expanded representation]]]]は、
0年より前や9999年より後の[[暦年]]を表現できるようにしたものです。 [SRC[>>7 2.3.8]]
- [141] [DFN[[RUBYB[[[切り詰めた表現]]]@en[truncated representation]]]]は、
構成する上位の部品を省略したものです。 [SRC[[[ISO 8601:2000]] 4.6]]
-- [[ISO 8601:2004]] では削除されています。
]FIG]
[127] [[完全表現]]は、週による表記と月日による表記のように、複数存在することがあります。
それ以外の表現も、月までの精度の表現と年までの精度の表現のように、複数存在することがあります。
月までの精度で年を展開した表現のように、複数に該当する表現もあり得ます。
[130] 複数の表現を組み合わせて構成される表現では、違った精度の表現を混在させることができます。
例えば[[日時]]を表す際に、[[日付]]の[[完全表現]]と[[時刻]]の[[精度を削減した表現]]を組み合わせることができます
(もちろんそれは[[日時]]の[[完全表現]]ではありません)。
[69] また記号の有無によって次の分類があります。
[FIG[
- [29] [DFN[[RUBYB[[[基本書式]]]@en[basic format]]]]は、
要求される精度に必要なだけの最小の時刻要素により構成される[[日時表現]]または[[日時書式表現]]の書式です
[SRC[>>7 2.3.3]]。
- [31] [DFN[[RUBYB[[[拡張書式]]]@en[extended format]]]]は、
[[基本書式]]に追加の[[分離子]]を含めて拡張したものです [SRC[>>7 2.3.4]]。
]FIG]
;; [30] [[基本書式]]は、[[平文]]では避けるべきです [SRC[>>7 2.3.3 NOTE]]。
[128] [[基本書式]]と[[拡張書式]]がある場合、[[拡張書式]]から特定の[[分離子]]を除去したものが[[基本書式]]になっています。
除去できる[[分離子]]がない場合には、[[拡張書式]]はありません。
[131] 複数の表現を組み合わせて構成される表現では、[[基本書式]]と[[拡張書式]]を混在させることは禁止されています。
;; [132] [[24時間制]]の普及によって[[分離子]]は必要なくなった [SRC[>>7 Annex A]]
という見方により、[[数字]]のみで構成される方が「基本」で、[[分離子]]が含まれる方が「拡張」
とされているようです。
[129] 表現や書式の種類は沢山ありますが、基本的にはどれが良いとかどれが優れているといったような区別ではなく、
必要に応じて使い分けることが想定されているようです。
[160] [[ISO 8601//ABNF]] に、[[日時表現]]を [[ABNF]] で表したものがあります。
* 日時書式表現
[28] [DFN[[RUBYB[[[日時書式表現]]]@en[date and time format representation]]]]は、
[[日時表現]]の群の書式を説明する[RUBYB[表現]@en[representation]]です [SRC[>>7 2.3.2]]。
[46] これは一種のパターン言語で、 [[ISO 8601]] 仕様書で[[日時表現]]の構文を定義する [SRC[>>7 3.3]]
ためのものですが、[[情報交換]]において[[日時表現]]がどのように記述されているかを示すために用いることもできます。
[EG[
[147] 例えば [CODE[YYYY-MM]] という[[日時書式表現]]は、 [CODE[2000-03]] や
[CODE[1985-12]] や [CODE[0003-01]] などの年月の[[日時表現]]を表しています。
]EG]
[47] [[情報交換の当事者間の合意]]により、[[日時書式表現]]を転送しても構いません [SRC[>>7 3.3, >>7 5]]。
その場合 [[ISO 8601]] により認められた[[日時書式表現]]のみを用いなければなりません [SRC[>>7 3.3]]。
また、[[情報交換の当事者間の合意]]により認められた[[日時表現]]に対応する[[日時書式表現]]のみ用いなければなりません
[SRC[>>7 5]]。
[51] [[ITU-T S.1]] [[レパートリ]] ([[telex]] など) を用いる環境では、
[[日時書式表現]]を用いてはなりません。 [SRC[>>7 3.4.1]]
[54] [[日時書式表現]]では、次の[[文字]]を使います [SRC[>>7 3.4.2]]。
,[[文字]],意味
,[CODE[[[Y]]]],[[年]]の[[数字]]
,[CODE[[[M]]]],[[月]]の[[数字]]
,[CODE[[[D]]]],[[日]]の[[数字]]
,[CODE[[[w]]]],[[週]]の[[数字]]
,[CODE[[[h]]]],[[時]]の[[数字]]
,[CODE[[[m]]]],[[分]]の[[数字]]
,[CODE[[[s]]]],[[秒]]の[[数字]]
,[CODE[[[n]]]],[[正数]]または[[0]]の[[数字]]
[55] [CODE[[[±]]]] は、[[正数]]または[[0]]の [CODE[[[+]]]] または[[負数]]の[[マイナス]]を表します
[SRC[>>7 3.4.2]]。ただし [CODE[[[±]]]] を使えない環境では、[[日時書式表現]]に
[CODE[[[±]]]] を含められません [SRC[>>7 3.4.1]]。
;; [86] [[0]] を表すために[[マイナス]]を用いることは認められていません。
[48] [[下線]]は、[[日時表現]]においてそれに相当する部分が複数文字に展開され得ることを表します [SRC[>>7 3.3]]。
>>54 の[[数字]]を表す[[文字]]に[[下線]]があると、それが0[[文字]]以上であることを表します [SRC[>>7 3.4.2]]。
[[日時書式表現]]の[[情報交換]]の時点で文字数がわかっている時には、[[下線]]を用いてはなりません [SRC[>>7 3.3, >>7 5]]。
[[文字]]に[[下線]]を付けられない環境では、[[文字]]の前に[[下線]]を置かなければなりません [SRC[>>7 3.4.1]]。
[56] その他の[[文字]]は、[[日時表現]]でも同じ[[文字]]を表します [SRC[>>7 3.4.2]]。
[133] [[JIS X 0301]] による拡張では、 [CODE[[[N]]]] が[[元号]]の記号を表します [SRC[>>27 5.1.3]]
* 日付の表現
[70] [[暦日付]]に関しては、次の表現が定義されています [SRC[>>7 4.1.2]]。
, ,[[基本形式]] ,[[拡張形式]]
,[[完全表現]] - [[日]] ,[CODE[YYYYMMDD]] ,[CODE[YYYY‐MM‐DD]]
,[[精度を削減した表現]] - [[月]] ,[CODE[YYYY‐MM]] ,なし
,[[精度を削減した表現]] - [[年]] ,[CODE[YYYY]] ,なし
,[[精度を削減した表現]] - [[世紀]] ,[CODE[YY]] ,なし
,[[展開表現]] - [[日]] ,[CODE[±_YYYYYMMDD]] ,[CODE[±_YYYYY‐MM‐DD]]
,[[展開表現]] - [[精度を削減した表現]] - [[月]] ,[CODE[±_YYYYY‐MM]] ,なし
,[[展開表現]] - [[精度を削減した表現]] - [[年]] ,[CODE[±_YYYYY]] ,なし
,[[展開表現]] - [[精度を削減した表現]] - [[世紀]] ,[CODE[±_YYY]] ,なし
[72] [[通日日付]]に関しては、次の表現が定義されています [SRC[>>7 4.1.3]]。
, ,[[基本形式]] ,[[拡張形式]]
,[[完全表現]] - [[日]] ,[CODE[YYYYDDD]] ,[CODE[YYYY‐DDD]]
,[[展開表現]] - [[日]] ,[CODE[±_YYYYYDDD]] ,[CODE[±_YYYYY‐DDD]]
[73] [[週日付]]に関しては、次の表現が定義されています [SRC[>>7 4.1.4]]。
, ,[[基本形式]] ,[[拡張形式]]
,[[完全表現]] - [[日]] ,[CODE[YYYYWwwD]] ,[CODE[YYYY‐Www‐D]]
,[[精度を削減した表現]] - [[週]] ,[CODE[YYYYWww]] ,[CODE[YYYY‐Www]]
,[[展開表現]] - [[日]] ,[CODE[±_YYYYYWwwD]] ,[CODE[±_YYYYY‐Www‐D]]
,[[展開表現]] - [[精度を削減した表現]] - [[週]] ,[CODE[±_YYYYWww]] ,[CODE[±_YYYY‐Www]]
;; [74] 「[CODE[W]]」はそのまま[[日時表現]]に現れます。
[HISTORY[
[142] 以前は更に次の表現が定義されており、[[情報交換の当事者間の合意]]により用いることができました
[SRC[[[ISO 8601:2000]] 5.2.1.3, 5.2.2.2, 5.2.3.3]]。
,* ,*[[基本形式]] ,*[[拡張形式]]
,[[切り詰めた表現]] - [[世紀]]省略 ,[CODE[YYMMDD]] ,[CODE[YY‐MM‐DD]]
,[[切り詰めた表現]] - [[精度を削減した表現]] - [[世紀]]省略 ,[CODE[‐YYMM]] ,[CODE[‐YY‐MM]]
,[[切り詰めた表現]] - [[精度を削減した表現]] - [[世紀]]省略 ,[CODE[‐YY]] ,なし
,[[切り詰めた表現]] - [[年]]省略 ,[CODE[--MMDD]] ,[CODE[‐‐MM‐DD]]
,[[切り詰めた表現]] - [[精度を削減した表現]] - [[年]]省略 ,[CODE[‐‐MM]] ,なし
,[[切り詰めた表現]] - [[精度を削減した表現]] - [[年]][[月]]省略 ,[CODE[‐‐‐DD]] ,なし
,[[切り詰めた表現]] - [[世紀]]省略 ,[CODE[YYDDD]] ,[CODE[YY‐DDD]]
,[[切り詰めた表現]] - [[精度を削減した表現]] - [[年]]省略 ,[CODE[‐DDD]] ([CODE[‐]] 1つ!),なし
,[[切り詰めた表現]] - [[世紀]]省略 ,[CODE[YYWwwD]] ,[CODE[YY‐Www‐D]]
,[[切り詰めた表現]] - [[精度を削減した表現]] - [[世紀]]省略 ,[CODE[YYWww]] ,[CODE[YY‐Www]]
,[[切り詰めた表現]] - [[十年紀]]省略 ,[CODE[-YWwwD]] ,[CODE[‐Y‐Www‐D]]
,[[切り詰めた表現]] - [[精度を削減した表現]] - [[十年紀]]省略 ,[CODE[‐YWww]] ,[CODE[‐Y‐Www]]
,[[切り詰めた表現]] - [[年]]省略 ,[CODE[‐WwwD]] ,[CODE[‐Www‐D]]
,[[切り詰めた表現]] - [[精度を削減した表現]] - [[年]]省略 ,[CODE[‐Www]] ,なし
,[[切り詰めた表現]] - [[週]]省略 ,[CODE[‐W‐D]] ,なし
[143] なおこれらの先頭の省略を表す [CODE[[[-]]]] は、曖昧でない場合省略できるとされていました
[SRC[[[ISO 8601:2000]] 4.6, 5.2.1.3, 5.2.2.2, 5.2.3.3]]。
]HISTORY]
[135] [[JIS X 0301]] は[[元号]]による[[日付]]の表現も定義しています [SRC[>>27 5.2.4]]
, ,[[基本形式]] ,[[拡張形式]]
,[[完全表現]] - [[日]] ,[CODE[YY.MM.DD]] ,[CODE[NYY.MM.DD]]
;; [136] [CODE[[[.]]]] は[[小数点]]ではなく、[[ピリオド]] [SRC[>>27 5.2.4]] とされています。
;; [137] [[完全表現]]以外は定義されていないようです。また、他の表現との組み合わせも定義されていないようです。
([[日時]]を組み合わせた表現すら定義されていませんが、いいのでしょうか。。。)
* 時の表現
[75] [[地方時]]に関しては、次の表現が定義されています [SRC[>>7 4.2.2]]。
, ,[[基本形式]] ,[[拡張形式]]
,[[完全表現]] - [[秒]] ,[CODE[hhmmss]] ,[CODE[hh:mm:ss]]
,[[精度を削減した表現]] - [[分]] ,[CODE[hhmm]] ,[CODE[hh:mm]]
,[[精度を削減した表現]] - [[時]] ,[CODE[hh]] ,なし
,[[小数付き表現]] - [[秒]] ,"[CODE[hhmmss,s_s]] ","[CODE[hh:mm:ss,s_s]]"
,[[小数付き表現]] - [[精度を削減した表現]] - [[分]],"[CODE[hhmm,m_m]]","[CODE[hh:mm,m_m]]"
,[[小数付き表現]] - [[精度を削減した表現]] - [[時]],"[CODE[hh,h_h]]",なし
[144] 以前は更に次の表現が定義されており、[[情報交換の当事者間の合意]]により用いることができました
[SRC[[[ISO 8601:2000]] 5.3.1.4]]。
, ,[[基本形式]] ,[[拡張形式]]
,[[切り詰めた表現]] - [[時]]省略 ,[CODE[‐mmss]] ,[CODE[‐mm:ss]]
,[[切り詰めた表現]] - [[精度を削減した表現]] - [[時]]省略 ,[CODE[‐mm]] ,なし
,[[切り詰めた表現]] - [[精度を削減した表現]] - [[分]]省略 ,[CODE[‐‐ss]] ,なし
,[[切り詰めた表現]] - [[小数付き表現]] - [[時]]省略 ,"[CODE[‐mmss,s_s]]","[CODE[‐mm:ss,s_s]]"
,[[切り詰めた表現]] - [[小数付き表現]] - [[精度を削減した表現]] - [[時]]省略 ,"[CODE[‐mm,m_m]]",なし
,[[切り詰めた表現]] - [[小数付き表現]] - [[精度を削減した表現]] - [[分]]省略 ,"[CODE[‐‐ss,s_s]]",なし
[145] なおこれらの先頭の省略を表す [CODE[[[-]]]] は、曖昧でない場合省略できるとされていました
[SRC[[[ISO 8601:2000]] 4.6, 5.3.1.4]]。
[81] [RUBYB[[[日のUTC]]]@en[UTC of day]]に関しては、 >>75 の各表現の後に
[DFN[[RUBYB[[[UTC指示子]]]@en[UTC designator]]]] [DFN[[CODE[[[Z]]]]]]
を付けたものが定義されています [SRC[>>7 4.2.4]]。
[87] [[地方時]]と、[[地方時]]と[[UTC]]の[[時差]]を示す必要がある時は、
[[地方時]]の直後に[[時差]]の表現を続けることができます [SRC[>>7 4.2.5.2]]。
[90] [[地方時]]においては[[空文字列]]、[[日のUTC]]においては [[UTC指示子]] [CODE[[[Z]]]]、
[[時差]]付きの場合においては[[時差]]のことを[DFN[[RUBYB[[[時間帯指示子]]]@en[zone designator]]]]といいます
[SRC[>>7 4.3.2]]。
[76] [[地方時]]の表現 (>>75) の前に[[時刻指示子]] [DFN[[CODE[[[T]]]]]] を付けた[DFN[[RUBYB[時刻指示子付き表現]@en[representation with time designator]]]]を用いることができます。
文脈上[[地方時]]の表現であるか不明瞭な場合には、これを用いなければなりません。 [SRC[>>7 4.2.2.5]]
;; [82] [[日のUTC]]の表現 (>>81) や[[時差]]付きの表現 (>>87) と[[時刻指示子]]の併用については言及がありません。
([[UTC指示子]]や[[時差]]により明確に[[時刻]]と判断できるからでしょうか。)
* 時差の表現
[83] [[地方時]]と[[日のUTC]]の[[時差]]に関しては、次の表現が定義されています [SRC[>>7 4.2.5.1]]。
, ,[[基本形式]] ,[[拡張形式]]
,[[分]] ,[CODE[±hhmm]] ,[CODE[±hh:mm]]
,[[時]] ,[CODE[±hh]] ,なし
[85] [[地方時]]の表現とは違って、[[分]]を省略できるのは、[[分]]が 0 になるときだけです [SRC[>>7 4.2.5.1]]。
[[精度を削減した表現]]や[[小数付き表現]]はありません。
[84] [[時差]]は[[地方時]]の表現と併用するもので、単独での利用は禁止されています [SRC[>>7 4.2.5.1]]。
* 日時の表現
[88] [[日時]]に関しては、次のいずれかの[[日付]]の表現 ([[完全表現]]または[[展開表現]])
の後に[[時刻指示子]] [CODE[[[T]]]] の後に >>75、>>81、>>87 のいずれかの[[時刻]]の表現が来るものが定義されています
[SRC[>>7 4.3]]。
,[[基本形式]] ,[[拡張形式]]
,[CODE[YYYYMMDD]] ,[CODE[YYYY‐MM‐DD]]
,[CODE[±_YYYYYMMDD]] ,[CODE[±_YYYYY‐MM‐DD]]
,[CODE[YYYYDDD]] ,[CODE[YYYY‐DDD]]
,[CODE[±_YYYYYDDD]] ,[CODE[±_YYYYY‐DDD]]
,[CODE[YYYYWwwD]] ,[CODE[YYYY‐Www‐D]]
,[CODE[±_YYYYYWwwD]] ,[CODE[±_YYYYY‐Www‐D]]
;; [161] [[日付]]に[[精度を削減した表現]]を使うことはできません。 ([[時刻]]では使えます。)
;; [162] [[ISO 8601:2000]] では、[[日付]]に[[切り詰めた表現]]が認められていました
[SRC[[[ISO 8601:2000]] 5.4.2]]。 ([[時刻]]では使えません。)
;; [89] [[日時]]共に[[完全表現]]であるものが、[[日時]]の[[完全表現]]です [SRC[>>7 4.3.2]]。
[91] [[時刻指示子]] [CODE[[[T]]]] は、[[情報交換の当事者間の合意]]があれば、
曖昧でない場合省略できます。 [SRC[>>7 4.3.2 NOTE]]
[92] [[日時]]の[[基本形式]]と[[拡張形式]]を混在させることはできません [SRC[>>7 4.3.3]]。
* 時間長の表現
[100] [[時間長]]に関しては、次の表現が定義されています [SRC[>>7 4.4.3]]。
- [[完全表現]] [CODE[Pn_nW]]
- [[完全表現]] [CODE[Pn_nYn_nMn_nDTn_nHn_nMn_nS]]
- [[精度を削減した表現]] [[情報交換の当事者間の合意]]により、下位の部品を省略できます
- [[小数付き表現]] [[情報交換の当事者間の合意]]により、下位の部品に[[小数点]]と[[小数部]]を含められます
[105] 値が0なら、その値と直後の[[指示子]]は省略できます。[[時]]と[[分]]と[[秒]]がすべて省略されるなら、
[CODE[[[T]]]] も省略しなければなりません。しかしすべて省略して [CODE[[[P]]]]
のみとしてはなりません。 [SRC[>>7 4.4.3.2]]
[104] 数字列が、その直後の[[指示子]]を単位とする[[時間長]]の値と解釈されます。
全体としては個々の[[時間長]]の[[和]]を表します。
[103] 数字列の最大桁数は、[[情報交換の当事者間の合意]]によります [SRC[>>7 4.4.3.2]]。
[101] [[時間長]]の表現は[[時間間隔]]や[[循環時間間隔]]の一部として使われるもので、
単独での利用を推進するものではない [SRC[>>7 4.4.3.2]] とされています。
;; [102] 実際にはむしろ[[時間間隔]]よりも[[時間長]]単独での方が用いられているようです。
** 代替形式
[107] [[情報交換の当事者間の合意]]により、[RUBYB[代替形式]@en[alternative format]]を用いることもできます。
これは日時の表現の前に [CODE[[[P]]]] を付けたものです。 [SRC[>>7 4.4.3.3]]
- [[暦日付]] [CODE[PYYYY‐MM‐DD]]
- [[通日日付]] [CODE[PYYYY‐DDD]]
- [[地方時]] [CODE[PThh:mm:dd]]
- [[暦日付]]の[[日時]] [CODE[PYYYY‐MM‐DDThh:mm:dd]]
- [[通日日付]]の[[日時]] [CODE[PYYYY‐DDDThh:mm:dd]]
[108] ここに示したものの他に、[[基本書式]]、[[精度を削減した表現]]、[[小数付き表現]]、[[展開表現]]も認められているようです。
;; [165] [[展開表現]]で[[負]]の[[年]]は意味をなさなそうですが、それも認められているのかは不明です。
[109] ただしこれらは日付としてではなく、[[時間長]]として扱われるため、値域が違っています。
[[年]]、[[月]]、[[日]]は 0 から始まります。また 12月、30日、24時、60分、60秒は認められないようです。
[SRC[>>7 4.4.3.3]]
;; [110] [[通日日付]]の場合が明記されていませんが、364日までOKでしょうか。[[暦日付]]との整合性を考えると
359日までOKかもしれません。
;; [119] [[週]]による表記が認められていないのは、1年が52週か53週か決められないから
[SRC[>>7 4.4.3.3 NOTE]] とされています。
* 時間間隔の表現
[93] [[時間間隔]]は、
- [94] 開始と終了 [SRC[>>7 4.4.1 a)]]
- [95] [[時間長]]と文脈 [SRC[>>7 4.4.1 b)]]
- [96] 開始と[[時間長]] [SRC[>>7 4.4.1 c)]]
- [97] [[時間長]]と終了 [SRC[>>7 4.4.1 d)]]
... の4種類の方法で記述できます [SRC[>>7 4.4.1]]。このうち >>94、>>96、>>97 は完結した情報ですが、
>>95 は[[時間]]のみで構成される不完全な [[time interval]] 情報で、
その意味を解釈するためには何らかの文脈情報が必要です。
[FIG(railroad)[
= |
== =
=== [[日時]]
=== [CODE(URI)[[[/]]]]
=== |
==== [[日時]]
==== [[時間長]]
== =
=== [[時間長]]
=== ?
==== [CODE(URI)[[[/]]]]
==== [[日時]]
]FIG]
** 開始と終了による表現
[111] [[日時]]の表現を、開始と終了で2つ並べて、[CODE[[[/]]]] で区切ったものです。
[112] すべて[[基本書式]]、またはすべて[[拡張書式]]で構成されなければなりません [SRC[>>7 4.4.4.1, >>7 4.4.4.5, >>7 4.4.5]]。
[113] 両者の前後関係は明記されていませんが、開始と終了ですから、前者が後者以下でなければならないものと思われます。
[121] 終了側の上位側が省略されていれば、開始側と同じ値とみなされます [SRC[>>7 4.4.5]]。
[EG[
[122] 例えば [CODE[1985-04-12/06-25]] は、1985年4月12日から1985年6月25日を表します [SRC[>>7 B.1.4]]。
]EG]
;; [124] 省略の仕方によっては何を表すのかわからなくなりますが、どこまで省略できるのか、
どう解釈するべきなのかは記述されていません。例えば[[基本書式]]で上位を省略したものと下位を省略したものは区別がまったくできないケースがあります。
また[[拡張書式]]でも、[[時]]まで省略して分と秒だけのものと、 [CODE[T]] まで省略して時と分だけで秒がないものは、
区別できないケースが有ります。
;; [159] 流石に日時とも省略されて[[時差]]だけ残るケースは認められないと思うのですが、どうでしょうか。
[120] 開始側に[[UTC指示子]]か[[時差]]が含まれていて、終了側に含まれていなければ、
開始側の[[時間帯]]が終了側にも適用されます [SRC[>>7 4.4.5]]。
[123] 精度を削減する時に前後で精度が一致していなければならないという規定はありませんから、
[CODE[1098-01-05/1993-03-05T00:12:44]] のような表現も良いことになります。
** 時間長と文脈による表現
[114] [[時間長]]の表現によって、[[時間間隔]]の表現とするものです [SRC[>>7 4.4.4.2, >>7 4.4.4.5, >>7 4.4.5]]。
** 開始と時間長による表現
[115] 開始の[[日時]]の表現と[[時間長]]の表現を並べて、 [CODE[[[/]]]] で区切ったものです。
[116] すべて[[基本書式]]、またはすべて[[拡張書式]]で構成されなければなりません [SRC[>>7 4.4.4.3, >>7 4.4.4.5, >>7 4.4.5]]。
** 時間長と終了による表現
[117] [[時間長]]と終了の[[日時]]の表現を並べて、 [CODE[[[/]]]] で区切ったものです。
[118] すべて[[基本書式]]、またはすべて[[拡張書式]]で構成されなければなりません [SRC[>>7 4.4.4.4, >>7 4.4.4.5, >>7 4.4.5]]。
* 反復時間間隔の表現
[125] [[反復時間間隔]]は、 [CODE[[[R]]]]、反復数、[CODE[[[/]]]]、[[時間間隔]]の順に並べて表現します。
反復数を省略した場合は、無制限の反復を表します。 [SRC[>>7 4.5]]
[FIG(railroad)[
= [CODE[[[R]]]]
= 数
= [CODE[[[/]]]]
= [[時間間隔]]
]FIG]
* 指示子
[57] [[日時表現]] (や[[日時書式表現]]) には[[ラテン文字]]がしばしば登場しますが、
これは[RUBYB[[[指示子]]]@en[designators]] [SRC[>>7 3.4.3]] と呼ばれています。
;; [148] [CODE[[[P]]]],[CODE[[[R]]]], [CODE[[[T]]]], [CODE[[[W]]]], [CODE[[[Z]]]]
が使われています [SRC[>>7 3.4.3]]。
[58] 更に[[時間]]の表現では、
[CODE[[[Y]]]], [CODE[[[M]]]], [CODE[[[W]]]], [CODE[[[D]]]], [CODE[[[H]]]], [CODE[[[S]]]]
が[[指示子]]として使われます [SRC[>>7 3.4.3]]。
;; [149] [CODE[[[M]]]] は[[月]]としても[[日]]としても使われます。
;; [59] [CODE[[[Y]]]], [CODE[[[M]]]], [CODE[[[D]]]] は[[日時書式表現]] (>>54) では違う意味になっています。
[134] [[JIS X 0301]] の拡張では、 [[M]]、[[明]]、[[T]]、[[大]]、[[S]]、[[昭]]、
[[H]]、[[平]]を[[元号]]を表す記号として使っています [SRC[>>27 5.1.3]]。
;; [138] [[ラテン文字]]と[[漢字]]の使い分けは、定義されていません。
* 先導0
[65] [[時刻]]要素で長さが決まっている場合には、必要なら[[先導0]]を用いなければなりません
[SRC[>>7 3.6]]。
[71] 可変長の部分では[[先導0]]は禁止されていないようです。
[163] [[先導0]]によって解釈が曖昧となることもあります。
[EG[
[164] 例えば25[[世紀]]を表す [CODE[25]] の[[展開表現]]である [CODE[+0025]] は、
25[[年]]を表す [CODE[0025]] の[[展開表現]]である [CODE[+0025]] と区別できません。
]EG]
* 文字と記号
[150] [[日時書式表現]]における [CODE[[[±]]]] (>>55)、 [CODE[[[/]]]] の代替の[[ダブルハイフン]] (>>98)、
特殊な扱いである[[ハイフン]]と[[マイナス]] (>>49)、 [[JIS X 0301]] による拡張である[[元号]] (>>134)
という多くの例外を除き、 [[ISO 8601]] の表現で用いられる[[文字]]は、 [[ISO/IEC 646]] や
[[ASCII]] で表現できます。
[52] [[日時表現]]では、[[大文字]]が使えない場合、[[小文字]]を使って構いません。
[SRC[>>7 3.4.1 NOTE 1]]
;; [60] [[日時書式表現]]では[[大文字]]と[[小文字]]の違いによって意味が変わることがあります。
[53] [RUBYB[[[空白]]]@en[space]]は、明示的に認められた場合を除き、使ってはなりません。
[SRC[>>7 3.4.1]] ただし [[ISO 8601]] で明示的に認めている箇所はありません。
[63] [CODE[[[:]]]] は、[[時]]、[[分]]、[[秒]]の区切りに使います [SRC[>>7 3.4.4]]。
;; [140] [[ISO 8601:2000]] では [CODE[#]] も定義されています [SRC[[[ISO 8601:2000]] 4.5]] が、例示にあるだけで、
実際には利用されていません。[[反復時間間隔]]において何度目の反復であるかを識別する際の区切子として使うことが想定されていたようです。
[[ISO 8601:2004]] には含まれていません。
** ハイフンとマイナス
[61] [[マイナス]]は、[[日時書式表現]]の [CODE[[[±]]]] に相当する[[日時表現]]の部分で使って、
[[負数]]を表します。
[62] [[ハイフン]]は、[[年]]、[[月]]、[[週]]、[[日]]の間の区切りとして使います [SRC[>>7 3.4.4]]。
[49] [[ハイフン]]や[[マイナス]]は、 [[ISO/IEC 646]] を元にした[[文字レパートリ]]にあっては、
[CODE(charname)@en[[[HYPHEN-MINUS]]]] を用います。 [SRC[>>7 3.4.1]]
;; [50] [[ISO/IEC 10646]] や [[Unicode]] がそのような[[文字レパートリ]]と言えるのかは不明です...
** 小数点
[77] [[小数点]]は[[時]]、[[分]]、[[秒]]の[[整数部]]と[[小数部]]を分けるために使います。
値が1に満たない時は[[整数部]]を 0 や 00 にしなければなりません。
[[小数点]]がある時は[[小数部]]は1桁以上必要です。 [SRC[>>7 4.2.2.4, >>7 4.4.3.2]]
[78] [[小数点]]は [CODE[[[,]]]] または [CODE[[[.]]]] を用いることができます。
[CODE[[[,]]]] が[RUBYB[より好ましい]@en[preferred]]とされています。 [SRC[>>7 4.2.2.4, >>7 4.4.3.2]]
[79] [[ISO 8601]] の[[日時書式表現]]や例示の[[日時表現]]はすべて [CODE[[[,]]]]
に統一されています。
[80] しかし [[XML Schemaの日付形式]]や[[HTMLの日付形式]]など主要なプロファイルはすべて
[CODE[[[.]]]] を採用しています。
[139] [[JIS X 0301]] によって拡張された[[元号]]による[[日付]]の表現では、
[[ピリオド]] [SRC[>>27 5.1.3]] を用いています。これは [CODE[[[,]]]] ではなく、
[CODE[[[.]]]] でなければなりません。
** 斜線
[64] [CODE[[[/]]]] は、[[time interval]] や [[recurring time interval]] の区切りに使います
[SRC[>>7 3.4.4, >>7 4.4.2 a)]]。
[98] [[応用分野]]によっては、 [CODE[[[/]]]] のかわりに[[二重ハイフン]]を使うことがあります
[SRC[>>7 4.4.2 NOTE]]。
;; [99] 「使うことがある」というのが、[[情報交換の当事者間の合意]]によって代用しても良いということなのか、
どういう意味なのか、はっきりしません。
* プロファイルと変種
[66] [[ISO 8601]] は[[日時表現]]や[[日時書式表現]]について、多くのバリエーションを定義していますし、
[[情報交換の当事者間の合意]]によって様々なオプションを採用できるとしています。
[68] [[情報交換の当事者間の合意]]によって何らかの表現を採用する場合、
他の表現が曖昧無く区別できるように注意する必要があります [SRC[>>7 3.7]]。
[151] 不思議なことに全体としての[[適合性]]の規定がありませんが、明らかに、
仕様上認められ得るすべての表現を生成したり、理解したりすることは求められておらず、
応用分野と当事者間の合意によって必要な範囲の構文に対応するべきであると解するのが妥当でしょう。
;; [152] 実際、[[情報交換の当事者間の合意]]によって認められる構文の採用の仕方によっては、
何を意味するか曖昧性が生じてしまうことがありますから、
無条件に任意の入力を受け付けるような実装は作れません。
[153] [[プログラミング言語]]、[[プロトコル]]その他各種の[[応用分野]]において、
[[ISO 8601]] の一部機能を選択したり、それを元に拡張したりしたものが存在します。
その粒度は様々で、自由度が高いものもあれば、一意に表現が定まるようなものもあります。
[154] [[ISO 8601]] を参照して定義されているものもあれば、完全に独自に互換な表現を定義しているものもあります。
[155] [[ISO 8601]] はそのような[[プロファイル]]の適合性を定義していませんから、
どれだけ制限や改変を加えても [[ISO 8601]] に適合していると主張できるのかははっきりしません。
[EG[
[156] 例えば [[RFC 3339の日付形式]]は [CODE[[[T]]]] や [CODE[[[Z]]]] を[[小文字]]でも良いとしていますが、
[[ISO 8601]] では >>52 の通り[[小文字]]による代用こそ認められていますが、
混在させると [[ISO 8601]] に適合しないかもしれません。
[157] [CODE[[[xs:dateTime]]]] では5桁以上の[[年]]を認めていますが、その前に [CODE[[[+]]]]
を書くことができませんから、[[完全表現]]でも[[展開表現]]でもありません。
[[ISO 8601]] に適合しない拡張ということになります。
[158] [CODE[[[xs:gYear]]]] は[[年]]と[[時差]]を組み合わせていますが、 [[ISO 8601]]
ではこのような組み合わせ方は定義されていません。
]EG]
[9]
[[RFC 3339の日付形式]]は、特定の日時を表す[[部分集合]]で、
新しい [[IETF]] ではこれを採用することが推奨されています。
[10] [[XML Schema]] の仕様書第2部ではいろいろな基本的な[[データ型]]を規定していますが、
その中には RFC 3339 の日付形式に極めてよく似たものを含め、
いくつかの日付や時刻や時間の表現のための形式が定義されています。
[23] [[HTMLの日付形式]]のいくつかは、 [[ISO 8601]] をもとに定義されています。
[24] [[JavaScriptの日付形式]]には、 [[ISO 8601の日付形式]]の[[プロファイル]]が含まれています。
[11]
[[W3C]] [[Member Submission]] [[Note]] である [CITE[Date and Time Formats]]
<http://www.w3.org/TR/1998/NOTE-datetime> は、
RFC 3339 の日付形式を同じものや、それよりも精度が低いもの
[WEAK[(時刻を省略したものなど)]] など数種類の形式
(通称 [[W3C-DTF]]) を提案しています。
[[HTML 4]] などが採用していますが、 XML Schema
データ型の登場により現在では時代遅れであると考えられています。
[4] [[RFC 2326の時刻形式]]の1つ、 [CODE(ABNF)[[[npt-range]]]] は、
ISO 8601 に従った書式で、演奏時間範囲を指定するのに使われます。
[5] [[PICSの日付形式]]は2種類あり、そのうちの新しい方は
ISO 8601 に基づく書式です。 XML Schema のデータ型のものと似ていますが、
微妙に異なります。
[14]
[CITE@en-us[XLIFF 1.1 Specification]] ([CODE[2006-07-08 02:30:08 +09:00]] 版) <http://www.oasis-open.org/committees/xliff/documents/cs-xliff-core-1.1-20031031.htm#date>
[22] [CITE[XLIFF 1.2 Specification]] ([TIME[2008-02-05 00:30:42 +09:00]] 版) <http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#date>
[15]
[CITE[Global Information Management eXchange Metrics Volume 1.0 Specification]] ([CODE[2007-02-24 17:44:10 +09:00]] 版) <http://www.lisa.org/standards/gmx/GMX-V.html#Attr_date>
>>14 の関連規格だけど日付形式は違う
([[名無しさん]])
[16]
[CITE@en-us[TMX Specification]] ([CODE[2007-02-24 17:51:20 +09:00]] 版) <http://www.lisa.org/standards/tmx/tmx.html#changedate>
([[名無しさん]])
[17]
[CITE@en-us[TMX Specification]] ([CODE[2007-02-24 17:51:20 +09:00]] 版) <http://www.lisa.org/standards/tmx/tmx.html#creationdate>
([[名無しさん]])
[18]
[CITE@en-us[TMX Specification]] ([CODE[2007-02-24 17:51:20 +09:00]] 版) <http://www.lisa.org/standards/tmx/tmx.html#lastusagedate>
([[名無しさん]])
[19]
[CITE[XML Text Memory Namespace 1.0 Specification]] ([CODE[2007-02-24 17:56:51 +09:00]] 版) <http://www.lisa.org/standards/xmltm/xml-tm.html#Attr_date>
([[名無しさん]])
[20]
[CITE@en[TermBase eXchange Link (TBX Link) Specification]] ([TIME[2007-02-24 18:05:26 +09:00]] 版) <http://www.lisa.org/standards/tbxlink/tbxlink.html#Attr_date>
- [[HTMLの時間形式]]
- [CODE(XML)@en[[[xs:duration]]]]
[12] [[PICSの日付形式]]は2種類あり、そのうちの古い方は
ISO 8601 に基づいた書式であることを意図していましたが、
日付の部分の区切子に誤って [CODE(char)[[[HYPHEN-MINUS]]]]
ではなく [CODE(char)[[[FULL STOP]]]] を使っていました。
(新しい方の書式では修正されています。)
[13] ISO 8601 の日本版規格である [[JIS X 0301]] (>>39) は、 ISO 8601
に加えて[[元号]]を使った[[和暦]]の[[年号]]を表現するための書式を規定しています。
[21] [[HTMLの日付形式]]は実質的に [[ISO 8601]] の[[プロファイル]]ですが、
[[ISO 8601]] を[[引用]]せずに定義されています。 [[HTML]] は[[閏秒]]に対応していないなどの違いもあります。
* 主要プロファイルの比較
[25] 主要なプロファイルの違いは次のようになっています。
[FIG(table)[
:x:
:年のみ :年のみ
:年月のみ :年月のみ
:年月日のみ :年月日のみ
:負の年 :負の年
:0年 :0年
:5桁以上の年 :5桁以上の年
:日時区切り :日時区切り
:24時 :24時
:秒の省略 :秒の省略
:秒の小数部 :秒の小数部
:[[閏秒]] :[[閏秒]]
:[[時間帯]] :[[時間帯]]
:[[UTC]] :[[UTC]]
:[[時間帯]]の[[時]]の範囲 :[[時間帯]]の[[時]]の範囲
:-0000 :[[-00:00]]
:x:[[HTML]]: [[妥当な大域日時文字列]]
:年のみ :×
:年月のみ :×
:年月日のみ :×
:負の年 :×
:0年 :×
:5桁以上の年 :○
:日時区切り :[CODE[T]]/[CODE[[[U+0020]]]]
:24時 :×
:秒の省略 :○
:秒の小数部 :指定可
:[[閏秒]] :なし
:[[時間帯]] :必須
:[[UTC]] :[CODE[Z]]
:[[時間帯]]の[[時]]の範囲 :0-23
:-0000 :禁止
:x:[[HTML]]: [[妥当な地方日時文字列]]
:年のみ :×
:年月のみ :×
:年月日のみ :×
:負の年 :×
:0年 :×
:5桁以上の年 :○
:日時区切り :[CODE[T]]/[CODE[[[U+0020]]]]
:24時 :×
:秒の省略 :○
:秒の小数部 :指定可
:[[閏秒]] :なし
:[[時間帯]] :禁止
:[[UTC]] :-
:[[時間帯]]の[[時]]の範囲 :-
:-0000 :-
:x:[CODE[[[xs:dateTime]]]] (1.1)
:年のみ :×
:年月のみ :×
:年月日のみ :×
:負の年 :○
:0年 :○
:5桁以上の年 :[[先導0]]禁止
:日時区切り :[CODE[T]]
:24時 :○
:秒の省略 :×
:秒の小数部 :指定可
:[[閏秒]] :なし
:[[時間帯]] :指定可
:[[UTC]] :[CODE[Z]]
:[[時間帯]]の[[時]]の範囲 :0-14
:-0000 :特記なし
:x:[CODE[[[xs:dateTimeStamp]]]] (1.1)
:年のみ :×
:年月のみ :×
:年月日のみ :×
:負の年 :○
:0年 :○
:5桁以上の年 :[[先導0]]禁止
:日時区切り :[CODE[T]]
:24時 :○
:秒の省略 :×
:秒の小数部 :指定可
:[[閏秒]] :なし
:[[時間帯]] :必須
:[[UTC]] :[CODE[Z]]
:[[時間帯]]の[[時]]の範囲 :0-14
:-0000 :特記なし
:x:[[RFC 3339の日付形式]]
:年のみ :×
:年月のみ :×
:年月日のみ :×
:負の年 :×
:0年 :○
:5桁以上の年 :×
:日時区切り :[CODE[T]]/[CODE[t]]/任意
:24時 :×
:秒の省略 :×
:秒の小数部 :指定可
:[[閏秒]] :60まで
:[[時間帯]] :必須
:[[UTC]] :[CODE[Z]]/[CODE[z]]
:[[時間帯]]の[[時]]の範囲 :0-23
:-0000 :「不明」の意
:x:[[W3C-DTF]]
:年のみ :○
:年月のみ :○
:年月日のみ :○
:負の年 :×
:0年 :○
:5桁以上の年 :×
:日時区切り :[CODE[T]]
:24時 :×
:秒の省略 :○
:秒の小数部 :指定可
:[[閏秒]] :なし
:[[時間帯]] :時刻ありなら必須
:[[UTC]] :[CODE[Z]]
:[[時間帯]]の[[時]]の範囲 :記載なし
:-0000 :特記なし
]FIG]
;; 詳細はそれぞれの項を参照。
* JIS X 0301
[39] [[JIS]] では [DFN[[[JIS X 0301]]]] が対応します。
([DFN[[[JIS X 0302]]]] (時刻形式) は X0301 に吸収されて廃止。)
[40] >>39 但し [[JIS X 0301]] では[[元号]]の表現についても規定しています。
そのため対応度は [[MOD]]。
[44] :2002 5.1.3 で、文字に [CODE[平]] とかを追加してるけど、 4.4 を修正してないのは初歩的なミス。 4.4 は
[[JIS X 0201]] で規定する文字を使うといっているが、 [CODE[平]] とかは 0201 にはない。
[41] [TIME[2002-12-14 15:38]] JIS X 0301 は 2002年に新版が出たらしいのですが、 [[JISC]] Web site からはまだ入手出来ないどころか、旧版も見れない状態が続いています。
[42] [TIME[2003-04-30 12:33]] >>41 今は :2002 が入手できるようです。
[172] [[元号]]を使う場合、次の接頭辞の後2桁の数字で年号を表記します。
[FIG(list short)[
- [[明]]
- [[大]]
- [[昭]]
- [[平]]
- [[M]]
- [[T]]
- [[S]]
- [[H]]
]FIG]
[173] また[[元号]]を使う場合は年月日の区切りに [CODE[-]] ではなく [CODE[.]]
を使います。
[174] なお明治6年の[[改暦]]より前は[[適用範囲外]]とされています。
[181] 年は2桁とされているので、平成100年以降も表せないことになります。
* CNS 7648
[169] [[CNS]] では [DFN[[[CNS 7648]]]] が対応します。
[170] [[CNS 7648]] は[[民国紀元]]の表現についても規定しているとされていて、
[CODE[R.O.C.74-04-12]] のように [CODE[R.O.C.]] を使って表記するとされています。
[171] 最新版である民国81年の改訂版の附録A ([[参考]]、12ページ) の例示には確かにそのような表記例が示されています。
しかしなぜか肝心の本文にはまったく言及がありません。
[178] [[日本語]]版 [[Wikipedia]] は [[CNS 7648]] で[[民国紀元]]が
「西暦と共に標準化されている」 [SRC[>>177]] と述べ、
[[CNS]] が[[民国紀元]]を定義していると誤解を招くような説明をしています。
[[中文]]版と[[英語]]版は [[CNS]] に[[民国紀元]]による表記方法があると述べるにとどまっています。
ただし[[英語]]版 [[Wikipedia]] は [CODE[ROC 93-05-03]] という例を示しています [SRC[>>179]]。
[[中文]]版 [[Wikipedia]] の例は [CODE[R.O.C.102-01-01]] [SRC[>>180]]、
[[日本語]]版 [[Wikipedia]] の例は [CODE[R.O.C.90-09-11]] [SRC[>>177]] で、
「.」が入っていて [CODE[[[U+0020]]]] は入りません。
[REFS[
- [180] [CITE@zh[民國紀年 - 维基百科,自由的百科全书]] ([TIME[2016-02-01 12:46:19 +09:00]] 版) <https://zh.wikipedia.org/wiki/%E6%B0%91%E5%9C%8B%E7%B4%80%E5%B9%B4>
- [177] [CITE@ja[民国紀元 - Wikipedia]] ([TIME[2016-01-05 10:30:35 +09:00]] 版) <https://ja.wikipedia.org/wiki/%E6%B0%91%E5%9B%BD%E7%B4%80%E5%85%83>
- [179] [CITE@en[Minguo calendar - Wikipedia, the free encyclopedia]] ([TIME[2016-02-04 21:50:05 +09:00]] 版) <https://en.wikipedia.org/wiki/Minguo_calendar>
]REFS]
* その他各国版
[183]
[FIG(list)[
- [[タイ]] [DFN[TIS 1111:2535]] (1992)
]FIG]
* 構文解析
[8] [[ISO 8601]] は同仕様に適合する[[日時]]の構文のみを定めており、
適合しない[[日時]]が含まれる可能性がある場合の[[構文解析]]や解釈の方法には言及がありません。
[67] また [[ISO 8601]] は[[日時]]の多様な表現方法を認めていますが、
その中には構文上互いに区別できないものもあります。 [[ISO 8601]] としては、
どの表現方法を採用するか事前に[[情報交換の当事者間の合意]]があるはずなので問題ないという立場なのでしょう。
[146] [[HTML]] は、任意の文字列をどう [[HTMLの日時形式]]として解釈するべきかを曖昧無く規定しています。
[166] [[ISO 8601]] の日時形式に基づく各種仕様の中にはエラー処理の方法を一部規定するものもありますが、多くは明確に規定していません。
* 歴史
[9] 1988年に初版 [DFN[[[ISO 8601:1988]]]] が、1991年に[[技術訂正票]]
[DFN[[[ISO 8691:1988]]/Cor.1:1991]] が、 2000年に改訂版 [DFN[[[ISO 8601:2000]]]] が、
2004年に改訂版 [DFN[[[ISO 8601:2004]]]] が出版されています。
*メモ
[FIG(amazon)[
日付 時刻
]FIG]
[43] ''Index of ftp://elsie.nci.nih.gov/pub'' <ftp://elsie.nci.nih.gov/pub>
[1] ''日付および時刻の国際標準表記法''
<http://www.geocities.co.jp/CollegeLife-Cafe/1646/roomazi/date-time.html>:
例の[[まーくん]]の、 ISO 8601 推進のための入門的紹介文の翻訳。
[2] >>1 まあさすがに原文がまーくんだけあって中々まーくん風味のまーくん的文章ですね(謎)
[3] >>1−2 なんだかんだ言ってまーくんって英語圏では有名人で影響力ある人だし、
実際 >>1 の原文も英語の技術系 ML とか Web とかでよく参照されてるよねぇ。
[106] [[ISO 8601:2004]] は日時の部分は比較的明確に定義されていますが、時間間隔の部分は参照が多く、
その指示するところが曖昧になっている感じがあります。
[FIG(quote)[
[FIGCAPTION[
[167] [CITE[OASIS Open Document Format for Office Applications (OpenDocument) Version 1.2 - Part 1: OpenDocument Schema]]
([TIME[2011-09-29 13:00:00 +09:00]] 版)
<http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#attribute-number_calendar>
]FIGCAPTION]
> gengou: Japanese Gengou calendar, Emperor eras. Identical to Gregorian calendar but with different eras for each emperor. Consumers may implement only the modern eras starting 1868, Meiji, Taisho, Showa and Heisei. Earlier dates are then displayed using the Gregorian calendar '''['''JIS X 0301''']'''.
]FIG]