-
Notifications
You must be signed in to change notification settings - Fork 68
/
x15.9.html
1779 lines (1775 loc) · 94.6 KB
/
x15.9.html
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
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html class="split chapter"><head><meta charset="utf-8"><title>15.9 Date Objects # Ⓣ Ⓔ ① Ⓐ — Annotated ES5</title><link rel="stylesheet" href="style.css"><link href="x15.8.html" title="15.8 The Math Object " rel="prev">
<link href="spec.html" title="TOC" rel="index">
<link href="x15.10.html" title="15.10 RegExp (Regular Expression) Objects " rel="next">
</head><body><div class="head">
<h2 id="top">Annotated ECMAScript 5.1 <span id="timestamp"></span></h2>
<div id="mascot-treehouse">
<img id="mascot" align="left" src="js-mascot.svg" alt=""><img id="bubble" src="bubble.svg" alt=""></div>
<p id="slogan">‟Ex igne vita”</p>
<div id="annotations"></div>
<script src="timestamp.js"></script></div>
<nav>
<a href="x15.8.html">← 15.8 The Math Object </a> –
<a href="spec.html" class="toc-nav">TOC</a> –
<a href="x15.10.html">15.10 RegExp (Regular Expression) Objects →</a>
<ol class="toc"><li><ol><li><a href="x15.9.html#x15.9" id="x15.9-toc">15.9 Date Objects</a>
<b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> <ol><li><a href="x15.9.html#x15.9.1" id="x15.9.1-toc">15.9.1 Overview of Date Objects and Definitions of Abstract Operators</a>
<b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> <ol><li><a href="x15.9.html#x15.9.1.1" id="x15.9.1.1-toc">15.9.1.1 Time Values and Time Range</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.1.2" id="x15.9.1.2-toc">15.9.1.2 Day Number and Time within Day</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.1.3" id="x15.9.1.3-toc">15.9.1.3 Year Number</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.1.4" id="x15.9.1.4-toc">15.9.1.4 Month Number</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.1.5" id="x15.9.1.5-toc">15.9.1.5 Date Number</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.1.6" id="x15.9.1.6-toc">15.9.1.6 Week Day</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.1.7" id="x15.9.1.7-toc">15.9.1.7 Local Time Zone Adjustment</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.1.8" id="x15.9.1.8-toc">15.9.1.8 Daylight Saving Time Adjustment</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.1.9" id="x15.9.1.9-toc">15.9.1.9 Local Time</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.1.10" id="x15.9.1.10-toc">15.9.1.10 Hours, Minutes, Second, and Milliseconds</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.1.11" id="x15.9.1.11-toc">15.9.1.11 MakeTime (hour, min, sec, ms)</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.1.12" id="x15.9.1.12-toc">15.9.1.12 MakeDay (year, month, date)</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.1.13" id="x15.9.1.13-toc">15.9.1.13 MakeDate (day, time)</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.1.14" id="x15.9.1.14-toc">15.9.1.14 TimeClip (time)</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.1.15" id="x15.9.1.15-toc">15.9.1.15 Date Time String Format</a>
<b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> <ol><li><a href="x15.9.html#x15.9.1.15.1" id="x15.9.1.15.1-toc">15.9.1.15.1 Extended years</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li></ol></li></ol></li><li><a href="x15.9.html#x15.9.2" id="x15.9.2-toc">15.9.2 The Date Constructor Called as a Function</a>
<b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> <ol><li><a href="x15.9.html#x15.9.2.1" id="x15.9.2.1-toc">15.9.2.1 Date ( [ year [, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ] ] ] )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li></ol></li><li><a href="x15.9.html#x15.9.3" id="x15.9.3-toc">15.9.3 The Date Constructor</a>
<b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> <ol><li><a href="x15.9.html#x15.9.3.1" id="x15.9.3.1-toc">15.9.3.1 new Date (year, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ] )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.3.2" id="x15.9.3.2-toc">15.9.3.2 new Date (value)</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.3.3" id="x15.9.3.3-toc">15.9.3.3 new Date ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li></ol></li><li><a href="x15.9.html#x15.9.4" id="x15.9.4-toc">15.9.4 Properties of the Date Constructor</a>
<b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> <ol><li><a href="x15.9.html#x15.9.4.1" id="x15.9.4.1-toc">15.9.4.1 Date.prototype</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.4.2" id="x15.9.4.2-toc">15.9.4.2 Date.parse (string)</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.4.3" id="x15.9.4.3-toc">15.9.4.3 Date.UTC (year, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ])</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.4.4" id="x15.9.4.4-toc">15.9.4.4 Date.now ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li></ol></li><li><a href="x15.9.html#x15.9.5" id="x15.9.5-toc">15.9.5 Properties of the Date Prototype Object</a>
<b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> <ol><li><a href="x15.9.html#x15.9.5.1" id="x15.9.5.1-toc">15.9.5.1 Date.prototype.constructor</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.2" id="x15.9.5.2-toc">15.9.5.2 Date.prototype.toString ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.3" id="x15.9.5.3-toc">15.9.5.3 Date.prototype.toDateString ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.4" id="x15.9.5.4-toc">15.9.5.4 Date.prototype.toTimeString ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.5" id="x15.9.5.5-toc">15.9.5.5 Date.prototype.toLocaleString ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.6" id="x15.9.5.6-toc">15.9.5.6 Date.prototype.toLocaleDateString ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.7" id="x15.9.5.7-toc">15.9.5.7 Date.prototype.toLocaleTimeString ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.8" id="x15.9.5.8-toc">15.9.5.8 Date.prototype.valueOf ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.9" id="x15.9.5.9-toc">15.9.5.9 Date.prototype.getTime ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.10" id="x15.9.5.10-toc">15.9.5.10 Date.prototype.getFullYear ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.11" id="x15.9.5.11-toc">15.9.5.11 Date.prototype.getUTCFullYear ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.12" id="x15.9.5.12-toc">15.9.5.12 Date.prototype.getMonth ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.13" id="x15.9.5.13-toc">15.9.5.13 Date.prototype.getUTCMonth ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.14" id="x15.9.5.14-toc">15.9.5.14 Date.prototype.getDate ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.15" id="x15.9.5.15-toc">15.9.5.15 Date.prototype.getUTCDate ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.16" id="x15.9.5.16-toc">15.9.5.16 Date.prototype.getDay ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.17" id="x15.9.5.17-toc">15.9.5.17 Date.prototype.getUTCDay ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.18" id="x15.9.5.18-toc">15.9.5.18 Date.prototype.getHours ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.19" id="x15.9.5.19-toc">15.9.5.19 Date.prototype.getUTCHours ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.20" id="x15.9.5.20-toc">15.9.5.20 Date.prototype.getMinutes ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.21" id="x15.9.5.21-toc">15.9.5.21 Date.prototype.getUTCMinutes ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.22" id="x15.9.5.22-toc">15.9.5.22 Date.prototype.getSeconds ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.23" id="x15.9.5.23-toc">15.9.5.23 Date.prototype.getUTCSeconds ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.24" id="x15.9.5.24-toc">15.9.5.24 Date.prototype.getMilliseconds ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.25" id="x15.9.5.25-toc">15.9.5.25 Date.prototype.getUTCMilliseconds ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.26" id="x15.9.5.26-toc">15.9.5.26 Date.prototype.getTimezoneOffset ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.27" id="x15.9.5.27-toc">15.9.5.27 Date.prototype.setTime (time)</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.28" id="x15.9.5.28-toc">15.9.5.28 Date.prototype.setMilliseconds (ms)</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.29" id="x15.9.5.29-toc">15.9.5.29 Date.prototype.setUTCMilliseconds (ms)</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.30" id="x15.9.5.30-toc">15.9.5.30 Date.prototype.setSeconds (sec [, ms ] )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.31" id="x15.9.5.31-toc">15.9.5.31 Date.prototype.setUTCSeconds (sec [, ms ] )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.32" id="x15.9.5.32-toc">15.9.5.32 Date.prototype.setMinutes (min [, sec [, ms ] ] )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.33" id="x15.9.5.33-toc">15.9.5.33 Date.prototype.setUTCMinutes (min [, sec [, ms ] ] )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.34" id="x15.9.5.34-toc">15.9.5.34 Date.prototype.setHours (hour [, min [, sec [, ms ] ] ] )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.35" id="x15.9.5.35-toc">15.9.5.35 Date.prototype.setUTCHours (hour [, min [, sec [, ms ] ] ] )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.36" id="x15.9.5.36-toc">15.9.5.36 Date.prototype.setDate (date)</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.37" id="x15.9.5.37-toc">15.9.5.37 Date.prototype.setUTCDate (date)</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.38" id="x15.9.5.38-toc">15.9.5.38 Date.prototype.setMonth (month [, date ] )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.39" id="x15.9.5.39-toc">15.9.5.39 Date.prototype.setUTCMonth (month [, date ] )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.40" id="x15.9.5.40-toc">15.9.5.40 Date.prototype.setFullYear (year [, month [, date ] ] )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.41" id="x15.9.5.41-toc">15.9.5.41 Date.prototype.setUTCFullYear (year [, month [, date ] ] )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.42" id="x15.9.5.42-toc">15.9.5.42 Date.prototype.toUTCString ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.43" id="x15.9.5.43-toc">15.9.5.43 Date.prototype.toISOString ( )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li><li><a href="x15.9.html#x15.9.5.44" id="x15.9.5.44-toc">15.9.5.44 Date.prototype.toJSON ( key )</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li></ol></li><li><a href="x15.9.html#x15.9.6" id="x15.9.6-toc">15.9.6 Properties of Date Instances</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b> </li></ol></li></ol></li></ol></nav>
<h3 id="x15.9" class="splitme">15.9 Date Objects <a href="#x15.9">#</a> <a href="#x15.9-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h3>
<h4 id="x15.9.1">15.9.1 Overview of Date Objects and Definitions of Abstract Operators <a href="#x15.9.1">#</a> <a href="#x15.9.1-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h4>
<p>
The
following functions are abstract operations that operate on time
values (defined in <a href="#x15.9.1.1">15.9.1.1</a>). Note that, in every case, if any
argument to one of these functions is <b>NaN</b>, the result will be
<b>NaN</b>.</p>
<h5 id="x15.9.1.1">15.9.1.1 Time Values and Time Range <a href="#x15.9.1.1">#</a> <a href="#x15.9.1.1-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
A
Date object contains a Number indicating a particular instant in
time to within a millisecond. Such a Number is called a <i>time
value</i>. A time value may also be <b>NaN</b>, indicating that the
Date object does not represent a specific instant of time.</p>
<p>
Time
is measured in ECMAScript in milliseconds since 01 January, 1970
UTC. In time values leap seconds are ignored. It is assumed that
there are exactly 86,400,000 milliseconds per day. ECMAScript Number
values can represent all integers from –9,007,199,254,740,991 to
9,007,199,254,740,991; this range suffices to measure times to
millisecond precision for any instant that is within approximately
285,616 years, either forward or backward, from 01 January, 1970
UTC.</p>
<p>
The
actual range of times supported by ECMAScript Date objects is
slightly smaller: exactly –100,000,000 days to 100,000,000 days
measured relative to midnight at the beginning of 01 January, 1970
UTC. This gives a range of 8,640,000,000,000,000 milliseconds to
either side of 01 January, 1970 UTC.</p>
<p>
The
exact moment of midnight at the beginning of 01 January, 1970 UTC is
represented by the value <b>+0</b>.</p>
<h5 id="x15.9.1.2">15.9.1.2 Day Number and Time within Day <a href="#x15.9.1.2">#</a> <a href="#x15.9.1.2-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p class="sm-btm">
A
given time value <i>t</i> belongs to day number</p>
<p class="code-example">
<a href="#x15.9.1.2">Day</a>(<i>t</i>)
= <a href="x5.html#floor">floor</a>(<i>t</i> / msPerDay)</p>
<p class="sm-btm">
where
the number of milliseconds per day is</p>
<p class="code-example">
msPerDay
= 86400000</p>
<p class="sm-btm">
The
remainder is called the time within the day:</p>
<p class="code-example">
TimeWithinDay(<i>t</i>)
= <i>t </i><a href="x5.html#modulo">modulo</a> msPerDay</p>
<h5 id="x15.9.1.3">15.9.1.3 Year Number <a href="#x15.9.1.3">#</a> <a href="#x15.9.1.3-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p class="sm-btm">
ECMAScript
uses an extrapolated Gregorian system to map a day number to a year
number and to determine the month and date within that year. In this
system, leap years are precisely those which are (divisible by 4)
and ((not divisible by 100)
or (divisible by 400)).
The number of days in year number <i>y</i>
is therefore defined by</p>
<p class="code-example">
DaysInYear(<i>y</i>)
= 365 if (<i>y</i> <a href="x5.html#modulo">modulo</a> 4) <span class="symbol">≠</span>
0<br>= 366 if (<i>y</i> <a href="x5.html#modulo">modulo</a> 4) = 0 and (y <a href="x5.html#modulo">modulo</a> 100) <span class="symbol">≠</span>
0<br>= 365 if (<i>y</i> <a href="x5.html#modulo">modulo</a> 100) = 0 and (y <a href="x5.html#modulo">modulo</a> 400) <span class="symbol">≠</span>
0<br>= 366 if (<i>y</i> <a href="x5.html#modulo">modulo</a> 400) = 0</p>
<p class="sm-btm">
All
non-leap years have 365
days with the usual number of days per month and leap years have an
extra day in February. The <dfn id="DayFromYear">day number of the first day of year <i>y</i></dfn>
is given by:</p>
<p class="code-example">
DayFromYear(<i>y</i>) =
365 <span class="symbol">×</span> (<i>y</i><span class="symbol">−</span>1970)
+ <a href="x5.html#floor">floor</a>((<i>y</i><span class="symbol">−</span>1969)/4) <span class="symbol">−</span>
<a href="x5.html#floor">floor</a>((<i>y</i><span class="symbol">−</span>1901)/100) +
<a href="x5.html#floor">floor</a>((<i>y</i><span class="symbol">−</span>1601)/400)</p>
<p class="sm-btm">
The
<dfn id="TimeFromYear">time value of the start of a year</dfn> is:</p>
<p class="code-example">
TimeFromYear(<i>y</i>) =
msPerDay <span class="symbol">×</span> <a href="#DayFromYear">DayFromYear</a>(<i>y</i>)</p>
<p class="sm-btm">
<dfn id="YearFromTime">A
time value determines a year by</dfn>:</p>
<p class="code-example">
YearFromTime(<i>t</i>) =
the largest integer <i>y</i> (closest to positive infinity) such
that <a href="#TimeFromYear">TimeFromYear</a>(<i>y</i>) <span class="symbol">≤</span> <i>t</i></p>
<p class="sm-btm">
The
<dfn id="InLeapYear">leap-year</dfn> function is 1 for a time within a leap year and otherwise
is zero:</p>
<p class="code-example">
<a href="#InLeapYear">InLeapYear</a>(<i>t</i>) =
0 if DaysInYear(<a href="#YearFromTime">YearFromTime</a>(<i>t</i>)) = 365<br>= 1 if
DaysInYear(<a href="#YearFromTime">YearFromTime</a><i>(t</i>)) = 366</p>
<h5 id="x15.9.1.4">15.9.1.4 Month Number <a href="#x15.9.1.4">#</a> <a href="#x15.9.1.4-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p class="sm-btm">
Months
are identified by an integer in the range 0
to 11, inclusive. The
mapping MonthFromTime(<i>t</i>) from a time value <i>t</i> to a
month number is defined by:</p>
<p class="date-definition">
MonthFromTime(<i>t</i>) =
0 if 0 <span class="symbol">≤</span> DayWithinYear(<i>t</i>)
< 31<br> = 1 if 31 <span class="symbol">≤</span>
DayWithinYear (<i>t</i>) < 59+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>)<br> =
2 if 59+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>) <span class="symbol">≤</span>
DayWithinYear (<i>t</i>) < 90+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>)<br> =
3 if 90+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>) <span class="symbol">≤</span>
DayWithinYear (<i>t</i>) < 120+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>)<br> =
4 if 120+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>) <span class="symbol">≤</span>
DayWithinYear (<i>t</i>) < 151+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>)<br> =
5 if 151+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>) <span class="symbol">≤</span>
DayWithinYear (<i>t</i>) < 181+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>)<br> =
6 if 181+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>) <span class="symbol">≤</span>
DayWithinYear (<i>t</i>) < 212+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>)<br> =
7 if 212+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>) <span class="symbol">≤</span>
DayWithinYear (<i>t</i>) < 243+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>)<br> =
8 if 243+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>) <span class="symbol">≤</span>
DayWithinYear (<i>t</i>) < 273+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>)<br> =
9 if 273+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>) <span class="symbol">≤</span>
DayWithinYear (<i>t</i>) < 304+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>)<br> =
10 if 304+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>) <span class="symbol">≤</span>
DayWithinYear (<i>t</i>) < 334+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>)<br> =
11 if 334+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>) <span class="symbol">≤</span>
DayWithinYear (<i>t</i>) < 365+<a href="#InLeapYear">InLeapYear</a>(<i>t</i>)</p>
<p>where</p>
<p class="date-definition">
<dfn id="DayWithinYear">DayWithinYear(<i>t</i>)</dfn> =
<a href="#x15.9.1.2">Day</a>(<i>t</i>)<span class="symbol">−</span><a href="#DayFromYear">DayFromYear</a>(<a href="#YearFromTime">YearFromTime</a>(<i>t)</i>)</p>
<p>
A
month value of 0
specifies January; 1
specifies February; 2
specifies March; 3
specifies April; 4 specifies
May; 5 specifies June; 6
specifies July; 7
specifies August; 8
specifies September; 9
specifies October; 10
specifies November; and 11
specifies December. Note that <a href="#x15.9.1.4">MonthFromTime</a>(0)
= 0, corresponding to Thursday, 01 January, 1970.</p>
<h5 id="x15.9.1.5">15.9.1.5 Date Number <a href="#x15.9.1.5">#</a> <a href="#x15.9.1.5-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
A
date number is identified by an integer in the range 1
through 31, inclusive.
The mapping DateFromTime(<i>t</i>) from a time value <i>t</i> to a
month number is defined by:</p>
<p class="date-definition">
DateFromTime(<i>t</i>) =
<a href="#DayWithinYear">DayWithinYear</a>(<i>t</i>)+1 if <a href="#x15.9.1.4">MonthFromTime</a>(<i>t</i>)=0<br> =
<a href="#DayWithinYear">DayWithinYear</a>(<i>t</i>)<span class="symbol">−</span>30 if
<a href="#x15.9.1.4">MonthFromTime</a>(<i>t</i>)=1<br> = <a href="#DayWithinYear">DayWithinYear</a>(<i>t</i>)<span class="symbol">−</span>58<span class="symbol">−</span><a href="#InLeapYear">InLeapYear</a>(<i>t</i>) if
<a href="#x15.9.1.4">MonthFromTime</a>(<i>t</i>)=2<br> = <a href="#DayWithinYear">DayWithinYear</a>(<i>t</i>)<span class="symbol">−</span>89<span class="symbol">−</span><a href="#InLeapYear">InLeapYear</a>(<i>t</i>) if
<a href="#x15.9.1.4">MonthFromTime</a>(<i>t</i>)=3<br> =
<a href="#DayWithinYear">DayWithinYear</a>(<i>t</i>)<span class="symbol">−</span>119<span class="symbol">−</span><a href="#InLeapYear">InLeapYear</a>(<i>t</i>) if
<a href="#x15.9.1.4">MonthFromTime</a>(<i>t</i>)=4<br> =
<a href="#DayWithinYear">DayWithinYear</a>(<i>t</i>)<span class="symbol">−</span>150<span class="symbol">−</span><a href="#InLeapYear">InLeapYear</a>(<i>t</i>) if
<a href="#x15.9.1.4">MonthFromTime</a>(<i>t</i>)=5<br> =
<a href="#DayWithinYear">DayWithinYear</a>(<i>t</i>)<span class="symbol">−</span>180<span class="symbol">−</span><a href="#InLeapYear">InLeapYear</a>(<i>t</i>) if
<a href="#x15.9.1.4">MonthFromTime</a>(<i>t</i>)=6<br> =
<a href="#DayWithinYear">DayWithinYear</a>(<i>t</i>)<span class="symbol">−</span>211<span class="symbol">−</span><a href="#InLeapYear">InLeapYear</a>(<i>t</i>) if
<a href="#x15.9.1.4">MonthFromTime</a>(<i>t</i>)=7<br> =
<a href="#DayWithinYear">DayWithinYear</a>(<i>t</i>)<span class="symbol">−</span>242<span class="symbol">−</span><a href="#InLeapYear">InLeapYear</a>(<i>t</i>) if
<a href="#x15.9.1.4">MonthFromTime</a>(<i>t</i>)=8<br> =
<a href="#DayWithinYear">DayWithinYear</a>(<i>t</i>)<span class="symbol">−</span>272<span class="symbol">−</span><a href="#InLeapYear">InLeapYear</a>(<i>t</i>) if
<a href="#x15.9.1.4">MonthFromTime</a>(<i>t</i>)=9<br> =
<a href="#DayWithinYear">DayWithinYear</a>(<i>t</i>)<span class="symbol">−</span>303<span class="symbol">−</span><a href="#InLeapYear">InLeapYear</a>(<i>t</i>) if
<a href="#x15.9.1.4">MonthFromTime</a>(<i>t</i>)=10<br> =
<a href="#DayWithinYear">DayWithinYear</a>(<i>t</i>)<span class="symbol">−</span>333<span class="symbol">−</span><a href="#InLeapYear">InLeapYear</a>(<i>t</i>) if
<a href="#x15.9.1.4">MonthFromTime</a>(<i>t</i>)=11</p>
<h5 id="x15.9.1.6">15.9.1.6 Week Day <a href="#x15.9.1.6">#</a> <a href="#x15.9.1.6-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p class="sm-btm">
The
weekday for a particular time value <i>t</i>
is defined as</p>
<p class="code-example">
WeekDay(<i>t</i>)
= (<a href="#x15.9.1.2">Day</a>(<i>t</i>) + 4) <a href="x5.html#modulo">modulo</a> 7</p>
<p>
A
weekday value of 0
specifies Sunday; 1
specifies Monday; 2
specifies Tuesday; 3
specifies Wednesday; 4 specifies
Thursday; 5 specifies
Friday; and 6 specifies
Saturday. Note that <a href="#x15.9.1.6">WeekDay</a>(0) =
4, corresponding to Thursday, 01 January, 1970.</p>
<h5 id="x15.9.1.7">15.9.1.7 Local Time Zone Adjustment <a href="#x15.9.1.7">#</a> <a href="#x15.9.1.7-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
An
implementation of ECMAScript is expected to determine the local time
zone adjustment. The local time zone adjustment is a value LocalTZA
measured in milliseconds which when added to UTC represents the
local <i>standard</i> time. Daylight saving time is <i>not</i>
reflected by LocalTZA. The value LocalTZA does not vary with time
but depends only on the geographic location.</p>
<h5 id="x15.9.1.8">15.9.1.8 Daylight Saving Time Adjustment <a href="#x15.9.1.8">#</a> <a href="#x15.9.1.8-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
An
implementation of ECMAScript is expected to determine the daylight
saving time algorithm. The algorithm to determine the daylight
saving time adjustment DaylightSavingTA(<i>t</i>), measured in
milliseconds, must depend only on four things:</p>
<p class="sm-btm">
(1)
the time since the beginning of the year</p>
<p class="code-example">
<i>t</i>
– <a href="#TimeFromYear">TimeFromYear</a>(<a href="#YearFromTime">YearFromTime</a>(<i>t</i>))</p>
<p class="sm-btm">
(2)
whether <i>t</i> is in a
leap year</p>
<p class="code-example">
<a href="#InLeapYear">InLeapYear</a>(<i>t</i>)</p>
<p class="sm-btm">
(3)
the week day of the beginning of the year</p>
<p class="code-example">
<a href="#x15.9.1.6">WeekDay</a>(<a href="#TimeFromYear">TimeFromYear</a>(<a href="#YearFromTime">YearFromTime</a>(<i>t</i>))</p>
<p>
and
(4) the geographic location.</p>
<p>
The
implementation of ECMAScript should not try to determine whether the
exact time was subject to daylight saving time, but just whether
daylight saving time would have been in effect if the current
daylight saving time algorithm had been used at the time. This
avoids complications such as taking into account the years that the
locale observed daylight saving time year round.</p>
<p>
If
the host environment provides functionality for determining daylight
saving time, the implementation of ECMAScript is free to map the
year in question to an equivalent year (same leap-year-ness and same
starting week day for the year) for which the host environment
provides daylight saving time information. The only restriction is
that all equivalent years should produce the same result.</p>
<h5 id="x15.9.1.9">15.9.1.9 Local Time <a href="#x15.9.1.9">#</a> <a href="#x15.9.1.9-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p class="sm-btm">
Conversion
from UTC to local time is defined by</p>
<p class="code-example">
LocalTime(<i>t</i>)
= <i>t</i> + <a href="#x15.9.1.7">LocalTZA</a> + DaylightSavingTA(<i>t</i>)</p>
<p class="sm-btm">
Conversion
from local time to UTC is defined by</p>
<p class="code-example">
UTC(<i>t</i>)
= <i>t</i> –
<a href="#x15.9.1.7">LocalTZA</a> – DaylightSavingTA(<i>t</i>
– <a href="#x15.9.1.7">LocalTZA</a>)</p>
<p>
Note
that <a href="#x15.9.1.9">UTC</a>(<a href="#x15.9.1.9">LocalTime</a>(<i>t</i>))
is not necessarily always equal to <i>t</i>.</p>
<h5 id="x15.9.1.10">15.9.1.10 Hours, Minutes, Second, and Milliseconds <a href="#x15.9.1.10">#</a> <a href="#x15.9.1.10-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p class="sm-btm">
The
following functions are useful in decomposing time values:</p>
<p class="code-example">
HourFromTime(<i>t</i>) =
<a href="x5.html#floor">floor</a>(<i>t</i> / msPerHour) <a href="x5.html#modulo">modulo</a> HoursPerDay</p>
<p class="code-example">
MinFromTime(<i>t</i>) =
<a href="x5.html#floor">floor</a>(<i>t</i> / msPerMinute) <a href="x5.html#modulo">modulo</a> MinutesPerHour</p>
<p class="code-example">
SecFromTime(<i>t</i>) =
<a href="x5.html#floor">floor</a>(<i>t</i> / msPerSecond) <a href="x5.html#modulo">modulo</a> SecondsPerMinute</p>
<p class="code-example">
msFromTime(<i>t</i>) =
t <a href="x5.html#modulo">modulo</a> msPerSecond</p>
<p class="sm-btm">
where</p>
<p class="code-example">
HoursPerDay =
24</p>
<p class="code-example">
MinutesPerHour =
60</p>
<p class="code-example">
SecondsPerMinute =
60</p>
<p class="code-example">
<dfn id="msPerSecond">msPerSecond</dfn> =
1000</p>
<p class="code-example">
<dfn id="msPerMinute">msPerMinute</dfn> =
60000 = msPerSecond <span class="symbol">×</span>
SecondsPerMinute</p>
<p class="code-example">
<dfn id="msPerHour">msPerHour</dfn> =
3600000 = msPerMinute <span class="symbol">×</span>
MinutesPerHour</p>
<h5 id="x15.9.1.11">15.9.1.11 MakeTime (hour, min, sec, ms) <a href="#x15.9.1.11">#</a> <a href="#x15.9.1.11-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
The
operator MakeTime calculates a number of milliseconds from its four
arguments, which must be ECMAScript Number values. This operator
functions as follows:</p>
<ol><li><p>
If
<i>hour</i> is not finite or <i>min</i> is not finite or <i>sec</i>
is not finite or <i>ms</i> is not finite, return <b>NaN</b>.</p>
</li>
<li><p>
Let
<i>h</i> be <a href="x9.html#x9.4">ToInteger</a>(<i>hour</i>).</p>
</li>
<li><p>
Let
<i>m</i> be <a href="x9.html#x9.4">ToInteger</a>(<i>min</i>).</p>
</li>
<li><p>
Let
<i>s</i> be <a href="x9.html#x9.4">ToInteger</a>(<i>sec</i>).</p>
</li>
<li><p>
Let
<i>milli</i> be <a href="x9.html#x9.4">ToInteger</a>(<i>ms</i>).</p>
</li>
<li><p>
Let
<i>t</i> be <i>h</i> <code><b>*</b></code>
<a href="#msPerHour">msPerHour</a> <code><b>+</b></code> <i>m</i>
<code><b>*</b></code> <a href="#msPerMinute">msPerMinute</a> <code><b>+</b></code>
<i>s</i> <code><b>*</b></code>
<a href="#msPerSecond">msPerSecond</a> <code><b>+</b></code>
<i>milli</i>, performing the arithmetic according to IEEE 754 rules
(that is, as if using the ECMAScript operators <code><b>*</b></code>
and <code><b>+</b></code>).</p>
</li>
<li><p>
Return
<i>t</i>.</p>
</li></ol><h5 id="x15.9.1.12">15.9.1.12 MakeDay (year, month, date) <a href="#x15.9.1.12">#</a> <a href="#x15.9.1.12-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
The
operator MakeDay calculates a number of days from its three
arguments, which must be ECMAScript Number values. This operator
functions as follows:</p>
<ol><li><p>
If
<i>year</i> is not finite or <i>month</i> is not finite or <i>date</i>
is not finite, return <b>NaN</b>.</p>
</li>
<li><p>
Let
<i>y</i> be <a href="x9.html#x9.4">ToInteger</a>(<i>year</i>).</p>
</li>
<li><p>
Let
<i>m</i> be <a href="x9.html#x9.4">ToInteger</a>(<i>month</i>).</p>
</li>
<li><p>
Let
<i>dt</i> be <a href="x9.html#x9.4">ToInteger</a>(<i>date</i>).</p>
</li>
<li><p>
Let
<i>ym</i> be <i>y</i> + <a href="x5.html#floor">floor</a>(<i>m</i> /12).</p>
</li>
<li><p>
Let
<i>mn</i> be <i>m</i> <a href="x5.html#modulo">modulo</a> 12.</p>
</li>
<li><p>
Find
a value <i>t</i> such that <a href="#YearFromTime">YearFromTime</a>(<i>t</i>) <code><b>==</b></code>
<i>ym</i> and <a href="#x15.9.1.4">MonthFromTime</a>(<i>t</i>) <code><b>==</b></code>
<i>mn</i>) and <a href="#x15.9.1.5">DateFromTime</a>(<i>t</i>) <code><b>==</b></code>
1; but if this is not possible (because some argument is out of
range), return <b>NaN</b>.</p>
</li>
<li><p>
Return
<a href="#x15.9.1.2">Day</a>(<i>t</i>) + <i>dt</i> <span class="symbol">−</span> 1.</p>
</li></ol><h5 id="x15.9.1.13">15.9.1.13 MakeDate (day, time) <a href="#x15.9.1.13">#</a> <a href="#x15.9.1.13-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
The
operator MakeDate calculates a number of milliseconds from its two
arguments, which must be ECMAScript Number values. This operator
functions as follows:</p>
<ol><li><p>
If
<i>day</i> is not finite or <i>time</i> is not finite, return <b>NaN</b>.</p>
</li>
<li><p>
Return
<i>day</i> <span class="symbol">×</span> msPerDay + <i>time</i>.</p>
</li></ol><h5 id="x15.9.1.14">15.9.1.14 TimeClip (time) <a href="#x15.9.1.14">#</a> <a href="#x15.9.1.14-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
The
operator TimeClip calculates a number of milliseconds from its
argument, which must be an ECMAScript Number value. This operator
functions as follows:</p>
<ol><li><p>
If
<i>time</i> is not finite, return <b>NaN</b>.</p>
</li>
<li><p>
If
<a href="x5.html#abs">abs</a>(<i>time</i>) > 8.64 x 10<sup>15</sup>,
return <b>NaN</b>.</p>
</li>
<li><p>
Return
an implementation-dependent choice of either <a href="x9.html#x9.4">ToInteger</a>(<i>time</i>)
or <a href="x9.html#x9.4">ToInteger</a>(<i>time</i>) + (<b>+0</b>). (Adding a positive zero
converts <span class="symbol"><b>−</b></span><b>0</b> to
<b>+0</b>.)</p>
</li></ol><p class="sp">
</p><p><b class="note">NOTE</b> The point of
step 3 is that an implementation is permitted a choice of internal
representations of time values, for example as a 64-bit signed
integer or as a 64-bit floating-point value. Depending on the
implementation, this internal representation may or may not
distinguish <span class="symbol"><b>−</b></span><b>0</b> and
<b>+0</b>.</p>
<h5 id="x15.9.1.15">15.9.1.15 Date Time String Format <a href="#x15.9.1.15">#</a> <a href="#x15.9.1.15-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
ECMAScript
defines a string interchange format for date-times based upon a
simplification of the ISO 8601 Extended Format. The format is as
follows: <code><b>YYYY-MM-DDTHH:mm:ss.sss</b></code><code><i><b>Z</b></i></code></p>
<p>
Where
the fields are as follows:</p>
<table id="date-format"><tbody><tr><td><code><b>YYYY</b></code></td><td>is the decimal digits of the year in the Gregorian calendar.</td></tr><tr><td><code><b>-</b></code></td><td>“<code><b>-</b></code>” (hyphen) appears literally twice in the string.</td></tr><tr><td><code><b>MM</b></code></td><td>is the month of the year from 01 (January) to 12 (December).</td></tr><tr><td><code><b>DD</b></code></td><td>is the day of the month from 01 to 31.</td></tr><tr><td><code><b>T</b></code></td><td>“<code><b>T</b></code>” appears literally in the string, to indicate the beginning of the time element.</td></tr><tr><td><code><b>HH</b></code></td><td>is the number of complete hours that have passed since midnight as two decimal digits.</td></tr><tr><td><code><b>:</b></code></td><td>“<code><b>:</b></code>” (colon) appears literally twice in the string.</td></tr><tr><td><code><b>mm</b></code></td><td>is the number of complete minutes since the start of the hour as two decimal digits.</td></tr><tr><td><code><b>ss</b></code></td><td>is the number of complete seconds since the start of the minute as two decimal digits.</td></tr><tr><td><code><b>.</b></code></td><td>“<code><b>.</b></code>” (dot) appears literally in the string.</td></tr><tr><td><code><b>sss</b></code></td><td>is the number of complete milliseconds since the start of the second as three decimal digits.</td></tr><tr><td><code><b>Z</b></code></td><td>is the time zone offset specified as “<code><b>Z</b></code>” (for UTC) or either
“<code><b>+</b></code>” or “<code><b>-</b></code>” followed by a time expression <code><b>hh:mm</b></code></td></tr></tbody></table><p class="sp">This
format includes date-only forms:</p>
<p class="sp"><code><b>YYYY<br>YYYY-MM<br>YYYY-MM-DD</b></code></p>
<p>It also includes “date-time” forms that consist of one of the above
date-only forms immediately followed by “<code>T</code>”
and one of the following time forms with an optional time zone offset
appended:</p>
<p>
<code><b>THH:mm<br>THH:mm:ss<br>THH:mm:ss.sss</b></code></p>
<p>All
numbers must be base 10.
If the <code>MM</code> or <code>DD</code> fields are absent
“<code>01</code>” is used as the value. If the <code>mm</code> or
<code>ss</code> fields are absent “<code>00</code>” is used as the value
and the value of an absent <code>sss</code> file is “<code>000</code>”. The
value of an absent time zone offset is “<code>Z</code>”.</p>
<p>
Illegal
values (out-of-bounds as well as syntax errors) in a format string
means that the format string is not a valid instance of this format.</p>
<p class="sp"><b class="note">NOTE 1</b> As every day both starts and ends with
midnight, the two notations <code>00:00</code>
and <code>24:00</code>
are available to distinguish the two midnights that can be
associated with one date. This means that the following two
notations refer to exactly the same point in time: <code>1995-02-04T24:00</code>
and <code>1995-02-05T00:00</code></p>
<p class="sp"><b class="note">NOTE 2</b> There exists no international standard that
specifies abbreviations for civil time zones like CET, EST, etc. and
sometimes the same abbreviation is even used for two very different
time zones. For this reason, ISO 8601 and this format specifies
numeric representations of date and time.</p>
<h6 id="x15.9.1.15.1">15.9.1.15.1 Extended years <a href="#x15.9.1.15.1">#</a> <a href="#x15.9.1.15.1-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h6>
<p>
ECMAScript
requires the ability to specify 6
digit years (extended years); approximately 285,616
years, either forward or backward, from 01 January, 1970 UTC. To
represent years before 0
or after 9999, ISO 8601
permits the expansion of the year representation, but only by prior
agreement between the sender and the receiver. In the simplified
ECMAScript format such an expanded year representation shall have 2
extra year digits and is always prefixed with a + or – sign. The
year 0 is considered
positive and hence prefixed with a + sign.</p>
<h4 id="x15.9.2">15.9.2 The Date Constructor Called as a Function <a href="#x15.9.2">#</a> <a href="#x15.9.2-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h4>
<p>
When
<code><b>Date</b></code> is called as
a function rather than as a constructor, it returns a String
representing the current time (UTC).</p>
<p><b class="note">NOTE</b> The
function call <code><b>Date(</b></code><code>…</code><code><b>)</b></code>
is not equivalent to the object creation expression <code><b>new Date(</b></code><code>…</code><code><b>)</b></code>
with the same arguments.</p>
<h5 id="x15.9.2.1">15.9.2.1 Date ( [ year [, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ] ] ] ) <a href="#x15.9.2.1">#</a> <a href="#x15.9.2.1-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
All
of the arguments are optional; any arguments supplied are accepted
but are completely ignored. A String is created and returned as if
by the expression <code><b>(new
Date()).toString()</b></code> where <code><b>Date</b></code>
is the standard built-in constructor with that name and <code><b>toString</b></code>
is the standard built-in method <code><b><a href="#x15.9.5.2">Date.prototype.toString</a></b></code>.</p>
<h4 id="x15.9.3">15.9.3 The Date Constructor <a href="#x15.9.3">#</a> <a href="#x15.9.3-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h4>
<p>
When
<code><b>Date</b></code> is called as
part of a <code><b>new</b></code>
expression, it is a constructor: it initialises the newly created
object.</p>
<h5 id="x15.9.3.1">15.9.3.1 new Date (year, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ] ) <a href="#x15.9.3.1">#</a> <a href="#x15.9.3.1-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
When
<b>Date</b> is called with two to seven arguments, it computes the
date from <i>year</i>, <i>month</i>, and (optionally) <i>date</i>,
<i>hours</i>, <i>minutes</i>, <i>seconds</i> and <i>ms</i>.</p>
<p>
The
[[Prototype]] internal property of the newly constructed object is
set to the original Date prototype object, the one that is the
initial value of <code><b>Date.prototype</b></code>
(<a href="#x15.9.4.1">15.9.4.1</a>).</p>
<p>
The
[[Class]] internal property of the newly constructed object is set
to <code><b>"Date"</b></code>.</p>
<p>
The
[[Extensible]] internal property of the newly constructed object is
set to <b>true</b>.</p>
<p>
The
[[PrimitiveValue]] internal property of the newly constructed object
is set as follows:</p>
<ol><li><p>
Let
<i>y</i> be <a href="x9.html#x9.3">ToNumber</a>(<i>year</i>).</p>
</li>
<li><p>
Let
<i>m</i> be <a href="x9.html#x9.3">ToNumber</a>(<i>month</i>).</p>
</li>
<li><p>
If
<i>date</i> is supplied then let <i>dt</i> be <a href="x9.html#x9.3">ToNumber</a>(<i>date</i>);
else let <i>dt</i> be <b>1</b>.</p>
</li>
<li><p>
If
<i>hours</i> is supplied then let <i>h</i> be <a href="x9.html#x9.3">ToNumber</a>(<i>hours</i>);
else let <i>h</i> be <b>0</b>.</p>
</li>
<li><p>
If
<i>minutes</i> is supplied then let <i>min</i> be
<a href="x9.html#x9.3">ToNumber</a>(<i>minutes</i>); else let <i>min</i> be <b>0</b>.</p>
</li>
<li><p>
If
<i>seconds</i> is supplied then let <i>s</i> be <a href="x9.html#x9.3">ToNumber</a>(<i>seconds</i>);
else let <i>s</i> be <b>0</b>.</p>
</li>
<li><p>
If
<i>ms</i> is supplied then let <i>milli</i> be <a href="x9.html#x9.3">ToNumber</a>(<i>ms</i>);
else let <i>milli</i> be <b>0</b>.</p>
</li>
<li><p>
If <i>y</i> is not <b>NaN</b> and 0 <span class="symbol">≤</span> <a href="x9.html#x9.4">ToInteger</a>(<i>y</i>) <span class="symbol">≤</span> 99, then
let <i>yr</i> be 1900+<a href="x9.html#x9.4">ToInteger</a>(<i>y</i>); otherwise, let <i>yr</i>
be <i>y</i>.</p>
</li>
<li><p>
Let
<i>finalDate</i> be <a href="#x15.9.1.13">MakeDate</a>(<a href="#x15.9.1.12">MakeDay</a>(<i>yr</i>, <i>m</i>, <i>dt</i>),
<a href="#x15.9.1.11">MakeTime</a>(<i>h</i>, <i>min</i>, <i>s</i>, <i>milli</i>)).</p>
</li>
<li><p>
Set
the [[PrimitiveValue]] internal property of the newly constructed
object to <a href="#x15.9.1.14">TimeClip</a>(<a href="#x15.9.1.9">UTC</a>(<i>finalDate</i>)).</p>
</li></ol><h5 id="x15.9.3.2">15.9.3.2 new Date (value) <a href="#x15.9.3.2">#</a> <a href="#x15.9.3.2-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
The
[[Prototype]] internal property of the newly constructed object is
set to the original Date prototype object, the one that is the
initial value of <code><b>Date.prototype</b></code>
(<a href="#x15.9.4.1">15.9.4.1</a>).</p>
<p>
The
[[Class]] internal property of the newly constructed object is set
to <code><b>"Date"</b></code>.</p>
<p>
The
[[Extensible]] internal property of the newly constructed object is
set to <b>true</b>.</p>
<p>
The
[[PrimitiveValue]] internal property of the newly constructed object
is set as follows:</p>
<ol><li><p>
Let
<i>v</i> be <a href="x9.html#x9.1">ToPrimitive</a>(<i>value</i>).</p>
</li>
<li><p>
If
<a href="x8.html#Type">Type</a>(<i>v</i>) is String, then
</p>
<ol><li><p>
Parse
<i>v</i> as a date, in exactly the same manner as for the <code><b>parse</b></code>
method (<a href="#x15.9.4.2">15.9.4.2</a>); let <i>V</i> be the time value for this date.</p>
</li></ol></li>
<li><p>
Else,
let <i>V</i> be <a href="x9.html#x9.3">ToNumber</a>(<i>v</i>).</p>
</li>
<li><p>
Set
the [[PrimitiveValue]] internal property of the newly constructed
object to <a href="#x15.9.1.14">TimeClip</a>(<i>V</i>) and return.</p>
</li></ol><h5 id="x15.9.3.3">15.9.3.3 new Date ( ) <a href="#x15.9.3.3">#</a> <a href="#x15.9.3.3-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
The
[[Prototype]] internal property of the newly constructed object is
set to the original Date prototype object, the one that is the
initial value of <code><b>Date.prototype</b></code>
(<a href="#x15.9.4.1">15.9.4.1</a>).</p>
<p>
The
[[Class]] internal property of the newly constructed object is set
to <code><b>"Date"</b></code>.</p>
<p>
The
[[Extensible]] internal property of the newly constructed object is
set to <b>true</b>.</p>
<p>
The
[[PrimitiveValue]] internal property of the newly constructed object
is set to the time value (UTC) identifying the current time.</p>
<h4 id="x15.9.4">15.9.4 Properties of the Date Constructor <a href="#x15.9.4">#</a> <a href="#x15.9.4-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h4>
<p>
The
value of the [[Prototype]] internal property of the Date constructor
is the Function prototype object (<a href="x15.3.html#x15.3.4">15.3.4</a>).</p>
<p>
Besides
the internal properties and the <code><b>length</b></code>
property (whose value is <code><b>7</b></code>),
the Date constructor has the following properties:</p>
<h5 id="x15.9.4.1">15.9.4.1 Date.prototype <a href="#x15.9.4.1">#</a> <a href="#x15.9.4.1-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
The
initial value of <code><b>Date.prototype</b></code>
is the built-in Date prototype object (<a href="#x15.9.5">15.9.5</a>).</p>
<p>
This
property has the attributes { [[Writable]]: <b>false</b>,
[[Enumerable]]: <b>false</b>, [[Configurable]]: <b>false</b> }.</p>
<h5 id="x15.9.4.2">15.9.4.2 Date.parse (string) <a href="#x15.9.4.2">#</a> <a href="#x15.9.4.2-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
The
<code><b>parse</b></code> function
applies the <a href="x9.html#x9.8">ToString</a> operator to its argument and interprets the
resulting String as a date and time; it returns a Number, the UTC
time value corresponding to the date and time. The String may be
interpreted as a local time, a UTC time, or a time in some other
time zone, depending on the contents of the String. The function
first attempts to parse the format of the String according to the
rules called out in Date Time String Format (<a href="#x15.9.1.15">15.9.1.15</a>). If the
String does not conform to that format the function may fall back to
any implementation-specific heuristics or implementation-specific
date formats. Unrecognizable Strings or dates containing illegal
element values in the format String shall cause <code><b>Date.parse</b></code>
to return <b>NaN</b>.</p>
<p>If
<i>x</i> is any Date
object whose milliseconds amount is zero within a particular
implementation of ECMAScript, then all of the following expressions
should produce the same numeric value in that implementation, if all
the properties referenced have their initial values:</p>
<p class="code-example">
<code><i><b>x</b></i></code><code><b>.valueOf()</b></code></p>
<p class="code-example">
<code><b>Date.parse(</b></code><code><i><b>x</b></i></code><code><b>.toString())</b></code></p>
<p class="code-example">
<code><b>Date.parse(</b></code><code><i><b>x</b></i></code><code><b>.toUTCString())</b></code></p>
<p class="code-example">
<code><b>Date.parse(</b></code><code><i><b>x</b></i></code><code><b>.toISOString())</b></code></p>
<p>However,
the expression</p>
<p class="code-example">
<code><b>Date.parse(</b></code> <i>x</i><code><b>.toLocaleString())</b></code></p>
<p>
is
not required to produce the same Number value as the preceding three
expressions and, in general, the value produced by <code><b>Date.parse</b></code>
is implementation-dependent when given any String value that does
not conform to the Date Time String Format (<a href="#x15.9.1.15">15.9.1.15</a>) and that
could not be produced in that implementation by the <code><b>toString</b></code>
or <code><b>toUTCString</b></code>
method.</p>
<h5 id="x15.9.4.3">15.9.4.3 Date.UTC (year, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ] ) <a href="#x15.9.4.3">#</a> <a href="#x15.9.4.3-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
When
the <code><b>UTC</b></code> function
is called with fewer than two arguments, the behaviour is
implementation-dependent. When the <code><b>UTC</b></code>
function is called with two to seven arguments, it computes the date
from <i>year</i>, <i>month</i>
and (optionally) <i>date</i>,
<i>hours</i>, <i>minutes</i>,
<i>seconds</i> and <i>ms</i>.
The following steps are taken:</p>
<ol><li><p>
Let
<i>y</i> be <a href="x9.html#x9.3">ToNumber</a>(<i>year</i>).</p>
</li>
<li><p>
Let
<i>m</i> be <a href="x9.html#x9.3">ToNumber</a>(<i>month</i>).</p>
</li>
<li><p>
If
<i>date</i> is supplied then let <i>dt</i> be <a href="x9.html#x9.3">ToNumber</a>(<i>date</i>);
else let <i>dt</i> be <b>1</b>.</p>
</li>
<li><p>
If
<i>hours</i> is supplied then let <i>h</i> be <a href="x9.html#x9.3">ToNumber</a>(<i>hours</i>);
else let <i>h</i> be <b>0</b>.</p>
</li>
<li><p>
If
<i>minutes</i> is supplied then let <i>min</i> be
<a href="x9.html#x9.3">ToNumber</a>(<i>minutes</i>); else let <i>min</i> be <b>0</b>.</p>
</li>
<li><p>
If
<i>seconds</i> is supplied then let <i>s</i> be <a href="x9.html#x9.3">ToNumber</a>(<i>seconds</i>);
else let <i>s</i> be <b>0</b>.</p>
</li>
<li><p>
If
<i>ms</i> is supplied then let <i>milli</i> be <a href="x9.html#x9.3">ToNumber</a>(<i>ms</i>);
else let <i>milli</i> be <b>0</b>.</p>
</li>
<li><p>
If <i>y</i> is not <b>NaN</b> and 0 <span class="symbol">≤</span> <a href="x9.html#x9.4">ToInteger</a>(<i>y</i>) <span class="symbol">≤</span> 99, then
let <i>yr</i> be 1900+<a href="x9.html#x9.4">ToInteger</a>(<i>y</i>); otherwise, let <i>yr</i>
be <i>y</i>.</p>
</li>
<li><p>
Return
<a href="#x15.9.1.14">TimeClip</a>(<a href="#x15.9.1.13">MakeDate</a>(<a href="#x15.9.1.12">MakeDay</a>(<i>yr</i>, <i>m</i>, <i>dt</i>),
<a href="#x15.9.1.11">MakeTime</a>(<i>h</i>, <i>min</i>, <i>s</i>, <i>milli</i>))).</p>
</li></ol><p>
The
<code><b>length</b></code> property of
the <code><b>UTC</b></code> function
is <b>7</b>.</p>
<p><b class="note">NOTE</b> The
<code>UTC</code> function differs from
the <code>Date</code> constructor in
two ways: it returns a time value as a Number, rather than creating
a Date object, and it interprets the arguments in UTC rather than as
local time.</p>
<h5 id="x15.9.4.4">15.9.4.4 Date.now ( ) <a href="#x15.9.4.4">#</a> <a href="#x15.9.4.4-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
The
<code><b>now</b></code> function
return a Number value that is the time value designating the UTC
date and time of the occurrence of the call to <code><b>now</b></code>.</p>
<h4 id="x15.9.5">15.9.5 Properties of the Date Prototype Object <a href="#x15.9.5">#</a> <a href="#x15.9.5-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h4>
<p>
The
Date prototype object is itself a Date object (its [[Class]] is
<code><b>"Date"</b></code>)
whose [[PrimitiveValue]] is <b>NaN</b>.</p>
<p>
The
value of the [[Prototype]] internal property of the Date prototype
object is the standard built-in Object prototype object (<a href="x15.2.html#x15.2.4">15.2.4</a>).</p>
<p>
In
following descriptions of functions that are properties of the Date
prototype object, the phrase “<dfn id="this-date-object">this Date object</dfn>” refers to the
object that is the <b>this</b> value for the invocation of the
function. Unless explicitly noted otherwise, none of these functions
are generic; a <b><a href="x15.11.html#x15.11.6.5" class="term-ref">TypeError</a></b> exception is thrown if the <b>this</b>
value is not an object for which the value of the [[Class]] internal
property is <code><b>"Date"</b></code>.
Also, the phrase “<dfn id="this-time-value">this time value</dfn>” refers to the Number value
for the time represented by this Date object, that is, the value of
the [[PrimitiveValue]] internal property of this Date object.</p>
<h5 id="x15.9.5.1">15.9.5.1 Date.prototype.constructor <a href="#x15.9.5.1">#</a> <a href="#x15.9.5.1-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
The
initial value of <code><b>Date.prototype.constructor</b></code>
is the built-in <code><b>Date</b></code>
constructor.</p>
<h5 id="x15.9.5.2">15.9.5.2 Date.prototype.toString ( ) <a href="#x15.9.5.2">#</a> <a href="#x15.9.5.2-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
This
function returns a String value. The contents of the String are
implementation-dependent, but are intended to represent the Date in
the current time zone in a convenient, human-readable form.</p>
<p><b class="note">NOTE</b> For
any Date value <code><i>d</i></code>
whose milliseconds amount is zero, the result of
<code>Date.parse(</code><code><i>d</i></code><code>.toString())</code>
is equal to <code><i>d</i></code><code>.valueOf()</code>.
See <a href="#x15.9.4.2">15.9.4.2</a>.</p>
<h5 id="x15.9.5.3">15.9.5.3 Date.prototype.toDateString ( ) <a href="#x15.9.5.3">#</a> <a href="#x15.9.5.3-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
This
function returns a String value. The contents of the String are
implementation-dependent, but are intended to represent the “date”
portion of the Date in the current time zone in a convenient,
human-readable form.</p>
<h5 id="x15.9.5.4">15.9.5.4 Date.prototype.toTimeString ( ) <a href="#x15.9.5.4">#</a> <a href="#x15.9.5.4-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
This
function returns a String value. The contents of the String are
implementation-dependent, but are intended to represent the “time”
portion of the Date in the current time zone in a convenient,
human-readable form.</p>
<h5 id="x15.9.5.5">15.9.5.5 Date.prototype.toLocaleString ( ) <a href="#x15.9.5.5">#</a> <a href="#x15.9.5.5-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
This
function returns a String value. The contents of the String are
implementation-dependent, but are intended to represent the Date in
the current time zone in a convenient, human-readable form that
corresponds to the conventions of the host environment’s current
locale.</p>
<p><b class="note">NOTE</b> The
first parameter to this function is likely to be used in a future
version of this standard; it is recommended that implementations do
not use this parameter position for anything else.</p>
<h5 id="x15.9.5.6">15.9.5.6 Date.prototype.toLocaleDateString ( ) <a href="#x15.9.5.6">#</a> <a href="#x15.9.5.6-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
This
function returns a String value. The contents of the String are
implementation-dependent, but are intended to represent the “date”
portion of the Date in the current time zone in a convenient,
human-readable form that corresponds to the conventions of the host
environment’s current locale.</p>
<p><b class="note">NOTE</b> The
first parameter to this function is likely to be used in a future
version of this standard; it is recommended that implementations do
not use this parameter position for anything else.</p>
<h5 id="x15.9.5.7">15.9.5.7 Date.prototype.toLocaleTimeString ( ) <a href="#x15.9.5.7">#</a> <a href="#x15.9.5.7-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
This
function returns a String value. The contents of the String are
implementation-dependent, but are intended to represent the “time”
portion of the Date in the current time zone in a convenient,
human-readable form that corresponds to the conventions of the host
environment’s current locale.</p>
<p><b class="note">NOTE</b> The
first parameter to this function is likely to be used in a future
version of this standard; it is recommended that implementations do
not use this parameter position for anything else.</p>
<h5 id="x15.9.5.8">15.9.5.8 Date.prototype.valueOf ( ) <a href="#x15.9.5.8">#</a> <a href="#x15.9.5.8-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<p>
The
<code><b>valueOf</b></code> function
returns a Number, which is <a href="#this-time-value">this time value</a>.</p>
<h5 id="x15.9.5.9">15.9.5.9 Date.prototype.getTime ( ) <a href="#x15.9.5.9">#</a> <a href="#x15.9.5.9-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<ol><li><p>
Return
<a href="#this-time-value">this time value</a>.</p>
</li></ol><h5 id="x15.9.5.10">15.9.5.10 Date.prototype.getFullYear ( ) <a href="#x15.9.5.10">#</a> <a href="#x15.9.5.10-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<ol><li><p>
Let
<i>t</i> be <a href="#this-time-value">this time value</a>.</p>
</li>
<li><p>
If
<i>t</i> is <b>NaN</b>, return <b>NaN</b>.</p>
</li>
<li><p>
Return
<a href="#YearFromTime">YearFromTime</a>(<a href="#x15.9.1.9">LocalTime</a>(<i>t</i>)).</p>
</li></ol><h5 id="x15.9.5.11">15.9.5.11 Date.prototype.getUTCFullYear ( ) <a href="#x15.9.5.11">#</a> <a href="#x15.9.5.11-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<ol><li><p>
Let
<i>t</i> be <a href="#this-time-value">this time value</a>.</p>
</li>
<li><p>
If
<i>t</i> is <b>NaN</b>, return <b>NaN</b>.</p>
</li>
<li><p>
Return
<a href="#YearFromTime">YearFromTime</a>(<i>t</i>).</p>
</li></ol><h5 id="x15.9.5.12">15.9.5.12 Date.prototype.getMonth ( ) <a href="#x15.9.5.12">#</a> <a href="#x15.9.5.12-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<ol><li><p>
Let
<i>t</i> be <a href="#this-time-value">this time value</a>.</p>
</li>
<li><p>
If
<i>t</i> is <b>NaN</b>, return <b>NaN</b>.</p>
</li>
<li><p>
Return
<a href="#x15.9.1.4">MonthFromTime</a>(<a href="#x15.9.1.9">LocalTime</a>(<i>t</i>)).</p>
</li></ol><h5 id="x15.9.5.13">15.9.5.13 Date.prototype.getUTCMonth ( ) <a href="#x15.9.5.13">#</a> <a href="#x15.9.5.13-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<ol><li><p>
Let
<i>t</i> be <a href="#this-time-value">this time value</a>.</p>
</li>
<li><p>
If
<i>t</i> is <b>NaN</b>, return <b>NaN</b>.</p>
</li>
<li><p>
Return
<a href="#x15.9.1.4">MonthFromTime</a>(<i>t</i>).</p>
</li></ol><h5 id="x15.9.5.14">15.9.5.14 Date.prototype.getDate ( ) <a href="#x15.9.5.14">#</a> <a href="#x15.9.5.14-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<ol><li><p>
Let
<i>t</i> be <a href="#this-time-value">this time value</a>.</p>
</li>
<li><p>
If
<i>t</i> is <b>NaN</b>, return <b>NaN</b>.</p>
</li>
<li><p>
Return
<a href="#x15.9.1.5">DateFromTime</a>(<a href="#x15.9.1.9">LocalTime</a>(<i>t</i>)).</p>
</li></ol><h5 id="x15.9.5.15">15.9.5.15 Date.prototype.getUTCDate ( ) <a href="#x15.9.5.15">#</a> <a href="#x15.9.5.15-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<ol><li><p>
Let
<i>t</i> be <a href="#this-time-value">this time value</a>.</p>
</li>
<li><p>
If
<i>t</i> is <b>NaN</b>, return <b>NaN</b>.</p>
</li>
<li><p>
Return
<a href="#x15.9.1.5">DateFromTime</a>(<i>t</i>).</p>
</li></ol><h5 id="x15.9.5.16">15.9.5.16 Date.prototype.getDay ( ) <a href="#x15.9.5.16">#</a> <a href="#x15.9.5.16-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<ol><li><p>
Let
<i>t</i> be <a href="#this-time-value">this time value</a>.</p>
</li>
<li><p>
If
<i>t</i> is <b>NaN</b>, return <b>NaN</b>.</p>
</li>
<li><p>
Return
<a href="#x15.9.1.6">WeekDay</a>(<a href="#x15.9.1.9">LocalTime</a>(<i>t</i>)).</p>
</li></ol><h5 id="x15.9.5.17">15.9.5.17 Date.prototype.getUTCDay ( ) <a href="#x15.9.5.17">#</a> <a href="#x15.9.5.17-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h5>
<ol><li><p>
Let
<i>t</i> be <a href="#this-time-value">this time value</a>.</p>
</li>
<li><p>
If