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.

Plus across DST boundary not working as expected

See original GitHub issue
luxon.DateTime
  .local(2016, 10, 30, 3, 59)
  .setZone("Europe/Athens", {keepLocalTime: true})
  .plus({minutes: 1})
  .hour
//=> 4

Daylight saving time 2016 in Greece began at 3:00 AM on Sunday, March 27 and ended at 4:00 AM on Sunday, October 30 All times are in Eastern European Time.

I expected the hour to be 3 – am I doing something wrong? Thanks for any pointers.

PS: Was porting https://github.com/harrisiirak/cron-parser from moment-timezone to luxon (and this is is one of the tests that’s failing: https://github.com/harrisiirak/cron-parser/blob/master/test/timezone.js#L149)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
icambroncommented, Jan 10, 2020

Hmm, yeah, this looks like a bug in keepLocalTime:

luxon.DateTime
  .local(2016, 10, 30, 2, 59)
  .setZone("Europe/Athens", {keepLocalTime: true})
  .toISO()
"2016-10-30T03:59:00.000+03:00"

A workaround:

luxon.DateTime
  .fromObject({ year: 2016, month: 10, day: 30, hour: 2, minute: 59, zone: "Europe/Athens" })
  .toISO()
"2016-10-30T02:59:00.000+03:00"

I’ll have to dig into why keepLocalTime is being weird there

0reactions
icambroncommented, Jan 26, 2020

Fixed in d4fd0af, will release shortly

Read more comments on GitHub >

github_iconTop Results From Across the Web

PHP DateTime does not correctly calculate time component ...
However because 150 days past 2019-06-14 crosses a DST boundary, shouldn't PHP subtract and hour from the time? I thought that PHP took...
Read more >
The Proper Way to Handle Multiple Time Zones in MySQL
In this article, I'll walk you through some fundamental considerations for working with date- and time-related data in MySQL.
Read more >
Guidelines for handling dates and times - Application Developer
This article describes developer guidelines for date and time handling and includes guidelines to handle daylight saving time (DST).
Read more >
AutoCAD 2022 Customer Reported Issues - Fixed
AutoCAD crashes when pick the boundary during Hatch. AutoCAD crashes when Plotting DWG with complex linetypes. AutoCAD crashes when Publish to ...
Read more >
4 Datetime Data Types and Time Zone Support
Otherwise, Oracle Database may not return the query results you expect. ... of the time zone region with Daylight Saving Time information included....
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