author | jmanson |
Tue, 12 May 2015 14:39:36 -0700 | |
changeset 30445 | e1e28b9abbe5 |
parent 27306 | cfb08ee17d57 |
permissions | -rw-r--r-- |
27213
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
1 |
/* |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
2 |
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
4 |
* |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
8 |
* |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
13 |
* accompanied this code). |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
14 |
* |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
18 |
* |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
21 |
* questions. |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
22 |
*/ |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
23 |
|
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
24 |
/** |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
25 |
* JDK-8062024: Issue with date.setFullYear when time other than midnight |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
26 |
* |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
27 |
* @test |
27306
cfb08ee17d57
8062216: [nashorn] regresion test failure with TimeZone
sundar
parents:
27213
diff
changeset
|
28 |
* @option -timezone=Asia/Calcutta |
27213
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
29 |
* @run |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
30 |
*/ |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
31 |
|
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
32 |
var date1 = new Date("January 01, 1950 00:00:00"); |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
33 |
print("Before:", date1); |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
34 |
date1.setFullYear(1960); |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
35 |
print("After:", date1); |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
36 |
|
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
37 |
var date2 = new Date("January 01, 1950 00:00:01"); |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
38 |
print("Before:", date2); |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
39 |
date2.setFullYear(1960); |
957656314d82
8062024: Issue with date.setFullYear when time other than midnight
sundar
parents:
diff
changeset
|
40 |
print("After:", date2); |