legacy
legacy copied to clipboard
`Date.date` incorrectly modifies local time with timezone offset
Version
110.99.4 (Latest)
Operating System
- [X] Any
- [ ] Linux
- [ ] macOS
- [ ] Windows
- [ ] Other Unix
OS Version
No response
Processor
- [X] Any
- [ ] Arm (using Rosetta)
- [ ] PowerPC
- [ ] Sparc
- [ ] x86 (32-bit)
- [ ] x86-64 (64-bit)
- [ ] Other
System Component
Basis Library
Severity
Minor
Description
Date.date
is meant to build a Date.date
from a specification. However it does not properly handle a provided timezone offset, and seems to be adding it to the date and time themselves.
Transcript
- val d = Date.date {year=2024, month=Date.Mar, day=14, hour=12, minute=30, second=0, offset = SOME (Time.fromSeconds 60)};
- Date.minute d;
val it = 31 : int
Expected Behavior
- val d = Date.date {year=2024, month=Date.Mar, day=14, hour=12, minute=30, second=0, offset = SOME (Time.fromSeconds 60)};
- Date.minute d;
val it = 30 : int
Namely, the local date and time should be preserved independently from the timezone offset
Steps to Reproduce
See transcript
Additional Information
This is implemented correctly in MLton and Poly/ML