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.

Time bigger than 24:00

See original GitHub issue

The bug

The .toFormat() method gave the 24:30 time for some reason.

To Reproduce

I could not reproduce it but I see in production logs that on 2021-03-30T21:53:05.354+0000 the following line

DateTime.fromISO('2021-03-30T23:30:00.000+0000').toFormat("y-LL-dd'T'TT'.'SSSZZZ")

produced the following result 2021-03-31T24:30:00.000-0000

Actual vs Expected behavior

Actual: 2021-03-31T24:30:00.000-0000 Expected: 2021-03-31T00:30:00.000-0000

Machine info

  • OS: Linux 4.14.214-160.339.amzn2.x86_64 x86_64 GNU/Linux

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
ddimitrioglocommented, May 18, 2021

@ramos-ph that’s a known issue, but I’m pretty sure that luxon maintainers could solve it in 2 ways:

  • set hourCycle: 'h23' by default
  • allow customers to pass hourCycle as a parameter based on their needs

By the way, changing locale does not fix it, they just have a different set of default values, that’s why for en-GB, de-DE or pt-BR it looks as expected

2reactions
icambroncommented, Jul 4, 2021

Fixed in 2.0. Thanks for the report

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is Military Time Midnight 2400 or 0000? The Answer Here!
Although it is also possible for military personnel to use 2400 in military time as a midnight indicator, 0000 is typically preferred.
Read more >
In 24 hour time, is there a functional difference between the ...
Times 00:00 and 24:00 are identical. This is a singularity (or degeneracy) in the clock … two values denote the same “time”.
Read more >
24-Hour Clock Conversion Chart.pdf
In 24-hour (military) time, 12:00am is equal to 0000 and is read as “0 hundred hours”. 1:00am, or 0100, is pronounced as “zero...
Read more >
How can I represent and operate on time values greater than ...
I'm currently doing some work in an application domain that uses time values greater than 24:00 to represent times after midnight that are ......
Read more >
What is 2400 Military Time? Step-by-Step Conversion Guide
2400 Military Time or 2400 Hours (24-Hour time format) is equivalent to 12:00 AM in Normal Time or Standard Time (12-Hour time format)....
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