Lines Matching full:date

30 // Test date construction from other dates.
31 var date0 = new Date(1111);
32 var date1 = new Date(date0);
35 var date2 = new Date(date0.toString());
39 var date0 = Date.parse("Dec 25 1995 1:30");
40 var date1 = Date.parse("Dec 25, 1995 1:30");
41 var date2 = Date.parse("Dec 25 1995, 1:30");
42 var date3 = Date.parse("Dec 25, 1995, 1:30");
49 var dMax = new Date(8.64e15);
55 var dOverflow = new Date(8.64e15+1);
58 var dMin = new Date(-8.64e15);
64 var dUnderflow = new Date(-8.64e15-1);
68 // Tests inspired by js1_5/Date/regress-346363.js
71 var a = new Date();
76 var b = new Date();
82 var c = new Date();
87 var d = new Date();
92 // Date
93 var e = new Date();
98 var f = new Date();
104 var g = new Date();
109 var h = new Date();
115 var g = new Date();
120 var h = new Date();
127 var i = new Date();
132 var j = new Date();
139 var k = new Date();
144 var l = new Date();
150 var d = new Date();
152 assertDoesNotThrow("new Date(-0, -0, -0, -0, -0, -0, -0)");
153 assertDoesNotThrow("new Date(0x40000000, 0x40000000, 0x40000000," +
155 assertDoesNotThrow("new Date(-0x40000001, -0x40000001, -0x40000001," +
160 // LayoutTests/fast/js/script-tests/date-utc-timeclip.js:
162 assertEquals(8639999999999999, Date.UTC(275760, 8, 12, 23, 59, 59, 999));
163 assertEquals(8640000000000000, Date.UTC(275760, 8, 13));
164 assertTrue(isNaN(Date.UTC(275760, 8, 13, 0, 0, 0, 1)));
165 assertTrue(isNaN(Date.UTC(275760, 8, 14)));
167 assertEquals(Date.UTC(-271821, 3, 20, 0, 0, 0, 1), -8639999999999999);
168 assertEquals(Date.UTC(-271821, 3, 20), -8640000000000000);
169 assertTrue(isNaN(Date.UTC(-271821, 3, 19, 23, 59, 59, 999)));
170 assertTrue(isNaN(Date.UTC(-271821, 3, 19)));
173 // Test creation with large date values.
174 d = new Date(1969, 12, 1, 99999999999);
176 d = new Date(1969, 12, 1, -99999999999);
178 d = new Date(1969, 12, 1, Infinity);
180 d = new Date(1969, 12, 1, -Infinity);
182 d = new Date(1969, 12, 1, 0);
185 d = new Date(1969, 12, 1, 0);
190 // Test creation with obscure date values.
191 assertEquals(8640000000000000, Date.UTC(1970, 0, 1 + 100000001, -24));
192 assertEquals(-8640000000000000, Date.UTC(1970, 0, 1 - 100000001, 24));
199 assertEquals(0, Date.parse("1970-01-01T00:00:00.000+00:00"));
200 assertEquals(0, Date.parse("1970-01-01T00:00:00.000-00:00"));
201 assertEquals(0, Date.parse("1970-01-01T00:00:00.000Z"));
202 assertEquals(0, Date.parse("1970-01-01T00:00:00.000"));
203 assertEquals(0, Date.parse("1970-01-01T00:00:00"));
204 assertEquals(0, Date.parse("1970-01-01T00:00"));
205 assertEquals(0, Date.parse("1970-01-01"));
207 assertEquals(0, Date.parse("1970-01T00:00:00.000+00:00"));
208 assertEquals(0, Date.parse("1970-01T00:00:00.000-00:00"));
209 assertEquals(0, Date.parse("1970-01T00:00:00.000Z"));
210 assertEquals(0, Date.parse("1970-01T00:00:00.000"));
211 assertEquals(0, Date.parse("1970-01T00:00:00"));
212 assertEquals(0, Date.parse("1970-01T00:00"));
213 assertEquals(0, Date.parse("1970-01"));
215 assertEquals(0, Date.parse("1970T00:00:00.000+00:00"));
216 assertEquals(0, Date.parse("1970T00:00:00.000-00:00"));
217 assertEquals(0, Date.parse("1970T00:00:00.000Z"));
218 assertEquals(0, Date.parse("1970T00:00:00.000"));
219 assertEquals(0, Date.parse("1970T00:00:00"));
220 assertEquals(0, Date.parse("1970T00:00"));
221 assertEquals(0, Date.parse("1970"));
223 assertEquals(0, Date.parse("+001970-01-01T00:00:00.000+00:00"));
224 assertEquals(0, Date.parse("+001970-01-01T00:00:00.000-00:00"));
225 assertEquals(0, Date.parse("+001970-01-01T00:00:00.000Z"));
226 assertEquals(0, Date.parse("+001970-01-01T00:00:00.000"));
227 assertEquals(0, Date.parse("+001970-01-01T00:00:00"));
228 assertEquals(0, Date.parse("+001970-01-01T00:00"));
229 assertEquals(0, Date.parse("+001970-01-01"));
231 assertEquals(0, Date.parse("+001970-01T00:00:00.000+00:00"));
232 assertEquals(0, Date.parse("+001970-01T00:00:00.000-00:00"));
233 assertEquals(0, Date.parse("+001970-01T00:00:00.000Z"));
234 assertEquals(0, Date.parse("+001970-01T00:00:00.000"));
235 assertEquals(0, Date.parse("+001970-01T00:00:00"));
236 assertEquals(0, Date.parse("+001970-01T00:00"));
237 assertEquals(0, Date.parse("+001970-01"));
239 assertEquals(0, Date.parse("+001970T00:00:00.000+00:00"));
240 assertEquals(0, Date.parse("+001970T00:00:00.000-00:00"));
241 assertEquals(0, Date.parse("+001970T00:00:00.000Z"));
242 assertEquals(0, Date.parse("+001970T00:00:00.000"));
243 assertEquals(0, Date.parse("+001970T00:00:00"));
244 assertEquals(0, Date.parse("+001970T00:00"));
245 assertEquals(0, Date.parse("+001970"));
247 // Check random date.
248 assertEquals(70671003500, Date.parse("1972-03-28T23:50:03.500+01:00"));
249 assertEquals(70674603500, Date.parse("1972-03-28T23:50:03.500Z"));
250 assertEquals(70674603500, Date.parse("1972-03-28T23:50:03.500"));
251 assertEquals(70674603000, Date.parse("1972-03-28T23:50:03"));
252 assertEquals(70674600000, Date.parse("1972-03-28T23:50"));
253 assertEquals(70588800000, Date.parse("1972-03-28"));
255 assertEquals(68338203500, Date.parse("1972-03T23:50:03.500+01:00"));
256 assertEquals(68341803500, Date.parse("1972-03T23:50:03.500Z"));
257 assertEquals(68341803500, Date.parse("1972-03T23:50:03.500"));
258 assertEquals(68341803000, Date.parse("1972-03T23:50:03"));
259 assertEquals(68341800000, Date.parse("1972-03T23:50"));
260 assertEquals(68256000000, Date.parse("1972-03"));
262 assertEquals(63154203500, Date.parse("1972T23:50:03.500+01:00"));
263 assertEquals(63157803500, Date.parse("1972T23:50:03.500Z"));
264 assertEquals(63157803500, Date.parse("1972T23:50:03.500"));
265 assertEquals(63157803000, Date.parse("1972T23:50:03"));
266 assertEquals(63072000000, Date.parse("1972"));
268 assertEquals(70671003500, Date.parse("+001972-03-28T23:50:03.500+01:00"));
269 assertEquals(70674603500, Date.parse("+001972-03-28T23:50:03.500Z"));
270 assertEquals(70674603500, Date.parse("+001972-03-28T23:50:03.500"));
271 assertEquals(70674603000, Date.parse("+001972-03-28T23:50:03"));
272 assertEquals(70674600000, Date.parse("+001972-03-28T23:50"));
273 assertEquals(70588800000, Date.parse("+001972-03-28"));
275 assertEquals(68338203500, Date.parse("+001972-03T23:50:03.500+01:00"));
276 assertEquals(68341803500, Date.parse("+001972-03T23:50:03.500Z"));
277 assertEquals(68341803500, Date.parse("+001972-03T23:50:03.500"));
278 assertEquals(68341803000, Date.parse("+001972-03T23:50:03"));
279 assertEquals(68341800000, Date.parse("+001972-03T23:50"));
280 assertEquals(68256000000, Date.parse("+001972-03"));
282 assertEquals(63154203500, Date.parse("+001972T23:50:03.500+01:00"));
283 assertEquals(63157803500, Date.parse("+001972T23:50:03.500Z"));
284 assertEquals(63157803500, Date.parse("+001972T23:50:03.500"));
285 assertEquals(63157803000, Date.parse("+001972T23:50:03"));
286 assertEquals(63072000000, Date.parse("+001972"));
291 assertEquals(-60904915200000, Date.parse("0040-01-01"));
292 assertEquals(-60273763200000, Date.parse("0060-01-01"));
293 assertEquals(-62167219200000, Date.parse("0000-01-01"));
294 assertEquals(-62167219200000, Date.parse("+000000-01-01"));
297 assertEquals(-63429523200000, Date.parse("-000040-01-01"));
298 assertEquals(-64060675200000, Date.parse("-000060-01-01"));
299 assertEquals(-124397510400000, Date.parse("-001972-01-01"));
302 assertEquals(70674603500, Date.parse("1972-03-28T23:50:03.500Z"));
309 assertEquals(70674603500 + ms, Date.parse(string), string);
311 assertEquals(70674603500 - ms, Date.parse(string), string);
315 assertThrows('Date.prototype.setTime.call("", 1);', TypeError);
316 assertThrows('Date.prototype.setYear.call("", 1);', TypeError);
317 assertThrows('Date.prototype.setHours.call("", 1, 2, 3, 4);', TypeError);
318 assertThrows('Date.prototype.getDate.call("");', TypeError);
319 assertThrows('Date.prototype.getUTCDate.call("");', TypeError);
321 assertThrows(function() { Date.prototype.getTime.call(0) }, TypeError); class
322 assertThrows(function() { Date.prototype.getTime.call("") }, TypeError);
324 assertThrows(function() { Date.prototype.getYear.call(0) }, TypeError);
325 assertThrows(function() { Date.prototype.getYear.call("") }, TypeError);
328 assertEquals(Object.prototype, Date.prototype.__proto__);
329 assertThrows(function () { Date.prototype.toString() }, TypeError);
332 delete Date.prototype.getUTCFullYear;
333 delete Date.prototype.getUTCMonth;
334 delete Date.prototype.getUTCDate;
335 delete Date.prototype.getUTCHours;
336 delete Date.prototype.getUTCMinutes;
337 delete Date.prototype.getUTCSeconds;
338 delete Date.prototype.getUTCMilliseconds;
339 (new Date()).toISOString();
342 assertTrue(delete Date.prototype.toString);
343 assertTrue('[object Date]' !== Date());