Skip to content

new Date(ISO-8601 with TimeZone) returns a wrong time within the Date object #2669

@Halanson

Description

@Halanson
let timestamp = '2025-12-01T07:53:46+01:00'; // this is an ISO-8601 timestamp
console.log(timestamp);
> 2025-12-01T07:53:46+01:00 // as expected
console.log(new Date(timestamp));
> Date: Mon Dec 1 2025 07:52:46 GMT+0000 // actually
> Date: Mon Dec 1 2025 07:53:46 GMT+0100 // expected

Running this in the Espruino Web IDE returns an offset in the Date object of one hour and minus one minute. The exprected result of new Date(timestamp) should be Mon Dec 1 2025 07:53:46 GMT+0100, with the correct timezone of +1 hour and the correct minute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions