Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"1816-01-01 00:01:04+00:34:08" can't be parsed as SQL #1647

Open
nickredmark opened this issue Aug 2, 2024 · 2 comments
Open

"1816-01-01 00:01:04+00:34:08" can't be parsed as SQL #1647

nickredmark opened this issue Aug 2, 2024 · 2 comments

Comments

@nickredmark
Copy link

nickredmark commented Aug 2, 2024

So, apparently due to time zone craziness, Postgresql can return dates like "1816-01-01 00:01:04+00:34:08" which fromSQL rejects as invalid because the regex doesn't expect seconds in the time offset.

@trulysinclair
Copy link

I'm getting this error using SQLite and Adonis, very frustrating

@diesieben07
Copy link
Collaborator

Unfortunately sub-minute offsets are really not very well supported in Luxon for various reasons. Internally, offset is stored in minutes. There are some ways to get fractional minutes in there, because some browsers return fractional seconds from Date#getTimezoneOffset. However this is not ideal at all, because it's all floating point math and not very accurate.
The proper fix requires some big refactors in this area to support sub-minute offsets.
This is not really my immediate radar, because sub-minute offsets are something that only occurs in historical time zone crazyness.

In the mean time, you probably should pre-process the timestamp you get from SQL to remove the second-based offset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants