-
Notifications
You must be signed in to change notification settings - Fork 40
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
FormatException on specific date and time (very strange) #483
Comments
This can be reproduced with
as the This should be fixed by adapting the validation code to check for the |
The issue I am facing is due to the Daylight saving adjustment in the mentioned timezones, which occurs on 12 March every year, hence the verify method fails because there is no consideration of Daylight saving. |
I am not sure I understand - the problem you described in the first post is reproducible without any specific reference to a time, just using the year. Could you elaborate? |
The issue I am facing is specific to the time (particularly hour) and not the year. If you try to parse this date 23-03-12 02:00:00 with this format y-MM-dd HH:mm:ss then the time returned is DayLight saving adjusted, i.e. 23-03-12 03:00:00 which then goes through the series of verify checks as I am using the
Hope the above stack trace helps. |
The format |
Try it on the 26th of March at 2:00am.
This failure depends on the underlying OS/browser's daylight savings time
transition code. This is different between North America/Europe/elsewhere.
But also, it's not that there's no accommodation of daylight savings time.
It's failing precisely because it does take it into account. There are
DateTimes that are not valid because they don't exist. If you try to create
one, the underlying DateTime code will adjust it to be something different.
It fails validation rather than silently changing the value.
…On Mon, Mar 27, 2023 at 8:58 AM Moritz ***@***.***> wrote:
The format y-MM-dd HH:mm:ss would expect the date to be 2023-03-12
02:00:00, which then works. Does this solve your problem?
—
Reply to this email directly, view it on GitHub
<#483>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA2QU6DMFBTBCUICUZG7S53W6GFGDANCNFSM6AAAAAAWAYVR3U>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Facing the same error in Eastern Timezone. Any fix? |
The error is that this |
-- 74641d7 by Moritz <[email protected]>: Fix #483 -- f21ac06 by Moritz <[email protected]>: Add changelog -- 7613552 by Moritz <[email protected]>: Changes as per review PiperOrigin-RevId: 559577268
Describe the bug
Getting the following exception on this specific date range only i.e. 23-03-12 02:00:00 to 23-03-12 02:59:59 with the following message
FormatException: Error parsing 23-03-12 02:00:00, invalid hour value: 2 in en_US with time zone offset -4:00:00.000000. Expected value between 3 and 3. Date parsed as 0023-03-12 03:00:00.000..
To Reproduce
The timezone should be either UTC -4, -5, -6, -7 and running a local test as following will reproduce it. Please note that this works fine for all the time windows except 02:00:00 till 02:59:59
Expected
The library should work as expected on the above mentioned time range.
The text was updated successfully, but these errors were encountered: