• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright JS Foundation and other contributors, http://js.foundation
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15var d;
16
17d = Date.UTC(undefined);
18assert (isNaN(d));
19
20d = Date.UTC({});
21assert (isNaN(d));
22
23d = Date.UTC(2015);
24assert (isNaN(d));
25
26d = Date.UTC(2000 + 15, 0);
27assert (d == 1420070400000);
28
29d = Date.UTC(2015, 0);
30assert (d == 1420070400000);
31
32d = Date.UTC(2015, 0, 1);
33assert (d == 1420070400000);
34
35d = Date.UTC(2015, 0, 1, 0);
36assert (d == 1420070400000);
37
38d = Date.UTC(2015, 0, 1, 0, 0);
39assert (d == 1420070400000);
40
41d = Date.UTC(2015, 0, 1, 0, 0, 0);
42assert (d == 1420070400000);
43
44d = Date.UTC(2015, 0, 1, 0, 0, 0, 0);
45assert (d == 1420070400000);
46
47d = Date.UTC(2015, 6, 3, 14, 35, 43, 123);
48assert (d == 1435934143123);
49