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

DateTime max and min values operates on local time zone #3836

Closed
lukaszkrzywizna opened this issue Jun 10, 2024 · 0 comments
Closed

DateTime max and min values operates on local time zone #3836

lukaszkrzywizna opened this issue Jun 10, 2024 · 0 comments

Comments

@lukaszkrzywizna
Copy link

lukaszkrzywizna commented Jun 10, 2024

Description

DateTime.MaxValue and DateTime.MinValue operate based on the local timezone/offset instead of UTC. This leads to incorrect date representations. For example, instead of getting 9999-12-31 for DateTime.MaxValue, it results in 10000-01-01 due to the timezone offset. This discrepancy causes errors when performing date range checks.

Repro code

open System

let maxMonth = DateTime.MaxValue.Month
printfn $"Max Month: {maxMonth}"
// for timezone Sat Jan 01 10000 00:59:59 GMT+0100 (Central European Standard Time)
// it gives 'Max Month: 1`

Related information

Fable version: 4.19.0
Operating system: macOS 14.5

ncave added a commit to ncave/Fable that referenced this issue Jun 12, 2024
@ncave ncave mentioned this issue Jun 12, 2024
@ncave ncave closed this as completed in 98fdb11 Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant