Debian Codegraph @

rhino/testsrc/tests/ecma/Date/15.9.1.1-1.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 gTestfile = '15.9.1.1-1.js';
7
8 /**
9 File Name: 15.9.1.1-1.js
10 ECMA Section: 15.9.1.1 Time Range
11 Description:
12 - leap seconds are ignored
13 - assume 86400000 ms / day
14 - numbers range fom +/- 9,007,199,254,740,991
15 - ms precision for any instant that is within
16 approximately +/-285,616 years from 1 jan 1970
17 UTC
18 - range of times supported is -100,000,000 days
19 to 100,000,000 days from 1 jan 1970 12:00 am
20 - time supported is 8.64e5*10e8 milliseconds from
21 1 jan 1970 UTC (+/-273972.6027397 years)
22
23 - this test generates its own data -- it does not
24 read data from a file.
25 Author: [email protected]
26 Date: 7 july 1997
27
28 Static variables:
29 FOUR_HUNDRED_YEARS
30
31 */
32
33 // every one hundred years contains:
34 // 24 years with 366 days
35 //
36 // every four hundred years contains:
37 // 97 years with 366 days
38 // 303 years with 365 days
39 //
40 // 86400000*365*97 = 3067372800000
41 // +86400000*366*303 = + 9555408000000
42 // = 1.26227808e+13
43 var FOUR_HUNDRED_YEARS = 1.26227808e+13;
44 var SECTION = "15.9.1.1-1";
45
46 writeHeaderToLog("15.9.1.1 Time Range");
47
48 var M_SECS;
49 var CURRENT_YEAR;
50
51 for ( M_SECS = 0, CURRENT_YEAR = 1970;
52 M_SECS < 8640000000000000;
53 M_SECS += FOUR_HUNDRED_YEARS, CURRENT_YEAR += 400 ) {
54
55 new TestCase( SECTION,
56 "new Date("+M_SECS+")",
57 CURRENT_YEAR,
58 (new Date( M_SECS)).getUTCFullYear() );
59 }
60
61 test();
62