-
Notifications
You must be signed in to change notification settings - Fork 4
/
234.txt
147 lines (105 loc) · 6.62 KB
/
234.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
* 仕様書
[REFS[
- [9] [CITE@en-GB[ECMAScript Language Specification ECMA-262 6th Edition - DRAFT]] ([TIME[2013-03-22 20:28:39 +09:00]] 版) <http://people.mozilla.org/~jorendorff/es6-draft.html#sec-15.9>
- [11] [CITE[Web IDL (Second Edition)]] ([TIME[2013-05-04 05:46:05 +09:00]] 版) <http://dev.w3.org/2006/webapi/WebIDL/#idl-Date>
- [10] '''[CITE[Web IDL (Second Edition)]] ([TIME[2013-05-04 05:46:05 +09:00]] 版) <http://dev.w3.org/2006/webapi/WebIDL/#es-Date>'''
- [14] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2013-05-05 06:42:10 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#create-a-date-object>
]REFS]
* [CODE(JS)@en[new Date]] コンストラクター
@@
* [CODE(JS)@en[Date]] 関数 (JavaScript)
[6] [CODE(JS)@en[[[Date]]]] を[[構築子]]としてではなく[[関数]]として呼ぶと、
[[ES3]] 的には引数で表される[[日時]]の [CODE(JS)@en[[[Date]]]] を文字列化したものが返ってくるはずですが、
[[Firefox]]、[[Chrome]]、[[Opera]]、[[WinIE8]] のいずれも引数を無視して現在日時を表す文字列を返すようです。
[TIME[2010-08-15T23:25:21.100Z]]
;; <javascript:Date(2001,3,5)>
* [CODE(IDL)@en[Date]] 型 (Web IDL)
** 文脈
[13]
[FIG(list)[
- [CODE(DOMm)@en[getStartDate]] ([CODE(DOMi)@en[HTMLMediaElement]])
- [CODE(DOMa)@en[valueAsDate]] ([CODE(DOMi)@en[HTMLInputElement]])
[HISTORY[
- [CODE(DOMa)@en[startDate]] ([CODE(DOMi)@en[HTMLMediaElement]])
]HISTORY]
]FIG]
** 演算
[15] [DFN[[RUBYB[[CODE(IDL)@en[Date]]オブジェクトを作成]@en[create a [CODE(IDL)@en[Date]] object]]]] [SRC[>>14]]
* 関連
[12] [CODE(DOMi)@en[DOMTimeStamp]]、[CODE(DOMi)@en[DOMHighResTimeStamp]]
のように[[数値]]として[[日時]]を表す[[型][型 (Web IDL)]]もあります。
[REFS[
- [7] [CITE@en[TimezonedDate]]
([[Robin Berjon]] 著, [TIME[2010-04-22 00:10:51 +09:00]] 版)
<http://lists.w3.org/Archives/Public/public-script-coord/2010AprJun/0000.html>
- [16] [CITE@en[Calendar API]] ([TIME[2012-10-02 20:46:33 +09:00]] 版) <http://dev.w3.org/2009/dap/calendar/#calendarevent-interface>
]REFS]
* メモ
[1] [CITE[15.9 Date オブジェクト (Date Objects)]] ([TIME[2002-07-19 22:24:44 +09:00]] 版) <http://www2u.biglobe.ne.jp/~oz-07ams/prog/ecma262r3/15-9_Date_Objects.html>
[4] [CITE[B 互換性 (Compatibility)]] ([TIME[2002-07-19 22:24:55 +09:00]] 版) <http://www2u.biglobe.ne.jp/%7Eoz-07ams/prog/ecma262r3/B_Compatibility.html#section-B.2>
[2] [[閏秒]]には対応していません。
[SRC@en[[[ES3]] 15.9.1.1]]
[3] [CITE[mozilla mozilla/js/src/jsdate.c]] ([TIME[2008-10-28 04:24:06 +09:00]] 版) <http://mxr.mozilla.org/mozilla/source/js/src/jsdate.c>
[5] [CITE@en-us[Date - MDC]] ([TIME[2008-12-14 17:06:41 +09:00]] 版) <https://developer.mozilla.org/ja/Core_JavaScript_1.5_Reference/Global_Objects/Date>
[8] [CITE[''''''[''''''whatwg'''''']'''''' Timing API proposal for measuring intervals]]
( ([TIME[2011-07-14 21:12:44 +09:00]] 版))
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-July/032343.html>
[17] [CITE@en[Web Applications 1.0 r8094 Revert r8083, since it leads to weird behaviour worse than just returning a new object each time. (It seems this isn't implemented by anyone yet anyway.)]]
( ([TIME[2013-07-27 07:21:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8093&to=8094>
[18] [CITE@en[Web Applications 1.0 r8113 Change startDate to a method to avoid the confusion of it being mutable.]]
( ([TIME[2013-08-01 06:29:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8112&to=8113>
[19] [CITE[IRC logs: freenode / #whatwg / 20130731]]
( ([TIME[2013-08-01 20:10:23 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20130731>
[20] [CITE@en[Bug 22824 – Remove Date from WebIDL]]
( ([TIME[2013-08-19 07:24:31 +09:00]] 版))
<https://www.w3.org/Bugs/Public/show_bug.cgi?id=22824>
[21] [CITE[Java8日付時刻APIの使いづらさと凄さ - きしだのはてな]]
( ([TIME[2013-09-17 06:57:18 +09:00]] 版))
<http://d.hatena.ne.jp/nowokay/20130917#1379376320>
[22] [CITE@en[File API | lastModified and Date attribute change]]
( ([[Arun Ranganathan]] 著, [TIME[2013-12-03 07:26:07 +09:00]] 版))
<http://lists.w3.org/Archives/Public/public-webapps/2013OctDec/0662.html>
[23] [CITE[HTML date format and Date.parse()]]
( ([TIME[2013-04-30 23:15:56 +09:00]] 版))
<https://mail.mozilla.org/pipermail/es-discuss/2013-April/030412.html>
[24] [CITE@en[Emotion Markup Language (EmotionML) 1.0]]
( ([TIME[2014-05-20 20:02:30 +09:00]] 版))
<http://www.w3.org/TR/emotionml/#s2.4.2.1>
[25] [CITE@en[RFC 3507 - Internet Content Adaptation Protocol (ICAP)]]
( ([TIME[2014-06-08 07:17:07 +09:00]] 版))
<http://tools.ietf.org/html/rfc3507#section-4.3.1>
[26] [CITE@en[Merge pull request #342 from martinthomson/issue324 · w3c/webrtc-pc@05909f7]]
([TIME[2015-10-24 13:20:07 +09:00]] 版)
<https://github.com/w3c/webrtc-pc/commit/05909f7d33c0dca829816c3ca47b93a593fb9fc6>
[27] [CITE@en[Close #279: stop using IDL Date so it can be removed from IDL · whatwg/html@260b66f]]
([TIME[2015-10-26 11:40:59 +09:00]] 版)
<https://github.com/whatwg/html/commit/260b66f352b34143c29bf3b2f5a17f9b5c34c1e1>
[28] [CITE@en[22824 – Remove Date from WebIDL]]
([TIME[2015-10-27 12:58:07 +09:00]] 版)
<https://www.w3.org/Bugs/Public/show_bug.cgi?id=22824>
[29] [CITE@en[Breaking: refactor structured clone into serialize/deserialize]]
([[domenic]]著, [TIME[2017-03-21 06:09:33 +09:00]])
<https://github.com/whatwg/html/commit/97d644c97335956610a31e8ad98d1a388c063e84>
[30] [CITE@en[API Reference - Web Application - Tizen Web Device API Reference - System - Time API | Tizen Developers]]
([TIME[2017-04-13 01:21:29 +09:00]])
<https://developer.tizen.org/development/api-references/web-application?redirect=https://developer.tizen.org/dev-guide/3.0.0/org.tizen.web.apireference/html/device_api/mobile/tizen/time.html>
[FIG(quote)[
[FIGCAPTION[
[31] [CITE[Safari には、1970年以前のDateが西半球で1ミリ秒ずれるバグがある - Qiita]]
([TIME[2017-12-02 13:07:23 +09:00]])
<https://qiita.com/kawanet/items/b081030911a12531561a>
]FIGCAPTION]
> new Date("1969-12-31T23:59:59.999+01:00").toJSON();
> // OK! => "1969-12-31T22:59:59.999Z"
> new Date("1969-12-31T23:59:59.999-01:00").toJSON();
> // NG! => "1970-01-01T00:59:59.998Z"
]FIG]
[32] [CITE@en["object getStartDate()" should be "Date getStartDate()" · Issue #3340 · whatwg/html]]
([TIME[2018-01-17 15:56:25 +09:00]])
<https://github.com/whatwg/html/issues/3340>
[33] [CITE[ECMAScript® 2020 Language Specification]]
([TIME[2019-03-02 01:48:00 +09:00]])
<https://tc39.github.io/ecma262/#sec-date-constructor>