Skip to content

Date.date incorrectly modifies local time with timezone offset  #305

@Skyb0rg007

Description

@Skyb0rg007

Version

110.99.4 (Latest)

Operating System

  • Any
  • Linux
  • macOS
  • Windows
  • Other Unix

OS Version

No response

Processor

  • 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

Email address

skyler.soss@gmail.com

Metadata

Metadata

Assignees

Labels

basis-libproblem with Standard ML Basis librarybugSomething isn't workingfixed-in-110.99.6issues that will be fixed in the 110.99.6 version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions