Debian Codegraph @

js/src/tests/test262/built-ins/Date/parse/without-utc-offset.js

raw
1 // Copyright (C) 2020 Sony Interactive Entertainment Inc. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-date.parse
5 description: >
6 Offsetless date-time strings are local time, offsetless date-only strings are UTC time
7 info: |
8 Date.parse ( string )
9
10 When the UTC offset representation is absent, date-only forms are interpreted
11 as a UTC time and date-time forms are interpreted as a local time.
12 ---*/
13
14 const timezoneOffsetMS = new Date(0).getTimezoneOffset() * 60000;
15
16 assert.sameValue(Date.parse('1970-01-01T00:00:00'), timezoneOffsetMS);
17 assert.sameValue(Date.parse('1970-01-01'), 0);
18
19 reportCompare(0, 0);