]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma/Date/15.9.4.2-1.js
2 * The contents of this file are subject to the Netscape Public
3 * License Version 1.1 (the "License"); you may not use this file
4 * except in compliance with the License. You may obtain a copy of
5 * the License at http://www.mozilla.org/NPL/
7 * Software distributed under the License is distributed on an "AS
8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 * implied. See the License for the specific language governing
10 * rights and limitations under the License.
12 * The Original Code is mozilla.org code.
14 * The Initial Developer of the Original Code is Netscape
15 * Communications Corporation. Portions created by Netscape are
16 * Copyright (C) 1998 Netscape Communications Corporation. All
24 * Reference: http://bugzilla.mozilla.org/show_bug.cgi?id=4088
25 * Description: Date parsing gets 12:30 AM wrong.
27 * js> d = new Date('1/1/1999 13:30 AM')
29 * js> d = new Date('1/1/1999 13:30 PM')
31 * js> d = new Date('1/1/1999 12:30 AM')
32 * Fri Jan 01 00:30:00 GMT-0800 (PST) 1999
33 * js> d = new Date('1/1/1999 12:30 PM')
34 * Fri Jan 01 12:30:00 GMT-0800 (PST) 1999
35 * Author: christine@netscape.com
38 var SECTION
= "15.9.4.2-1"; // provide a document reference (ie, ECMA section)
39 var VERSION
= "ECMA"; // Version of JavaScript or ECMA
40 var TITLE
= "Regression Test for Date.parse"; // Provide ECMA section title or a description
41 var BUGNUMBER
= "http://bugzilla.mozilla.org/show_bug.cgi?id=4088"; // Provide URL to bugsplat or bugzilla report
43 startTest(); // leave this alone
45 AddTestCase( "new Date('1/1/1999 12:30 AM').toString()",
46 new Date(1999,0,1,0,30).toString(),
47 new Date('1/1/1999 12:30 AM').toString() );
49 AddTestCase( "new Date('1/1/1999 12:30 PM').toString()",
50 new Date( 1999,0,1,12,30 ).toString(),
51 new Date('1/1/1999 12:30 PM').toString() );
53 AddTestCase( "new Date('1/1/1999 13:30 AM')",
55 new Date('1/1/1999 13:30 AM').toString() );
58 AddTestCase( "new Date('1/1/1999 13:30 PM')",
60 new Date('1/1/1999 13:30 PM').toString() );
62 test(); // leave this alone. this executes the test cases and