question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

parseISO returning wrong time on day of offset change

See original GitHub issue

In Germany the offset will change from +1 to +2 on March 29th. When using parseISO on a timestamp on this day the result is one hour off:

parseISO('2020-03-28T10:00:00') // Sat Mar 28 2020 10:00:00 GMT+0100 parseISO('2020-03-29T10:00:00') // Sun Mar 29 2020 11:00:00 GMT+0200 parseISO('2020-03-30T10:00:00') // Mon Mar 30 2020 10:00:00 GMT+0200

This happens on version 2.9.0

Anyone else ran into the same problem and has a potential fix for this?

EDIT: Just wanted to add that this happens on Chrome, Firefox and Edge Chromium

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
MrBlue9commented, Mar 3, 2020

just tried with the latest version 2.10.0. same result. returned dates are off by one hour

0reactions
kalekseevcommented, Mar 13, 2020

I created pr with a fix, but it uses completely another approach, anyone concerned please test it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Date-fns parseISO returning wrong date - javascript
I think it is just a timezone issue, try to append "T00:00" when you create your date object, when you don't specifies the...
Read more >
How to parse ISO 8601 date in Swift
Learn how to parse ISO 8601 date with ISO8601DateFormatter. ... This can be problematic if you want to communicate date and time information ......
Read more >
Moment.js | Guides
This section lays out some guidelines about how to correctly use the parser in your situation. Local vs UTC vs Offset. edit. Moment...
Read more >
How to use the date-fns.parseISO function in ...
parseISO examples, based on popular ways it is used in public projects. ... task by offset const iter = obj => { if...
Read more >
Working with dates and timezones in JavaScript: a survival ...
If we change the timezone setting on our computer to Oslo, ... Likewise, toISOString() always returns the date in UTC time, which you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found