michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: /** michael@0: File Name: 15.9.1.1-2.js michael@0: ECMA Section: 15.9.1.1 Time Range michael@0: Description: michael@0: - leap seconds are ignored michael@0: - assume 86400000 ms / day michael@0: - numbers range fom +/- 9,007,199,254,740,991 michael@0: - ms precision for any instant that is within michael@0: approximately +/-285,616 years from 1 jan 1970 michael@0: UTC michael@0: - range of times supported is -100,000,000 days michael@0: to 100,000,000 days from 1 jan 1970 12:00 am michael@0: - time supported is 8.64e5*10e8 milliseconds from michael@0: 1 jan 1970 UTC (+/-273972.6027397 years) michael@0: Author: christine@netscape.com michael@0: Date: 9 july 1997 michael@0: */ michael@0: michael@0: // every one hundred years contains: michael@0: // 24 years with 366 days michael@0: // michael@0: // every four hundred years contains: michael@0: // 97 years with 366 days michael@0: // 303 years with 365 days michael@0: // michael@0: // 86400000*366*97 = 3067372800000 michael@0: // +86400000*365*303 = + 9555408000000 michael@0: // = 1.26227808e+13 michael@0: michael@0: var FOUR_HUNDRED_YEARS = 1.26227808e+13; michael@0: var SECTION = "15.9.1.1-2"; michael@0: michael@0: writeHeaderToLog("15.9.1.1 Time Range"); michael@0: michael@0: var M_SECS; michael@0: var CURRENT_YEAR; michael@0: michael@0: for ( M_SECS = 0, CURRENT_YEAR = 1970; michael@0: M_SECS > -8640000000000000; michael@0: M_SECS -= FOUR_HUNDRED_YEARS, CURRENT_YEAR -= 400 ) { michael@0: michael@0: new TestCase( SECTION, michael@0: "new Date("+M_SECS+")", michael@0: CURRENT_YEAR, michael@0: (new Date( M_SECS )).getUTCFullYear() ); michael@0: michael@0: } michael@0: michael@0: test(); michael@0: