Debian Codegraph @

js/src/tests/non262/Date/parse-zulu-time.js

raw
1 // |reftest| skip-if(winWidget) -- Windows doesn't accept IANA names for the TZ env variable
2 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 const tests = [
8 "Aug 15, 2015 10:00Z",
9 "08/15/2015 10:00Z",
10 "Aug 15, 2015 10:00 Z",
11 ]
12
13 inTimeZone("GMT", () => {
14 for (const test of tests) {
15 const dt = new Date(test);
16 assertEq(dt.getTime(), new Date(2015, Month.August, 15, 10).getTime());
17 }
18 });
19
20 if (typeof reportCompare === "function")
21 reportCompare(true, true);