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

Consider making Date and DateTime not promote #51745

Open
LilithHafner opened this issue Oct 17, 2023 · 1 comment
Open

Consider making Date and DateTime not promote #51745

LilithHafner opened this issue Oct 17, 2023 · 1 comment
Labels
breaking This change will break code dates Dates, times, and the Dates stdlib module needs nanosoldier run This PR should have benchmarks run on it

Comments

@LilithHafner
Copy link
Member

Make this throw:

julia> using Dates

julia> promote(today(), now())
(DateTime("2023-10-17T00:00:00"), DateTime("2023-10-17T15:47:08.549"))

1, when placed on the floating point number line, unambiguously lands on 1.0
Date("2023-10-17"), when placed on the* continuous timeline, represents a range, not a point.

Recommended for consideration by triage a while ago

*assuming nonrelativistic speeds

@LilithHafner LilithHafner added breaking This change will break code dates Dates, times, and the Dates stdlib module needs nanosoldier run This PR should have benchmarks run on it labels Oct 17, 2023
@jariji
Copy link
Contributor

jariji commented Oct 18, 2023

Related, incomplete date/time strings parse: #28090

julia> Date("2001-01", dateformat"yyyy-mm-dd")
2001-01-01

julia> DateTime("2001-01", dateformat"yyyy-mm-dd")
2001-01-01T00:00:00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This change will break code dates Dates, times, and the Dates stdlib module needs nanosoldier run This PR should have benchmarks run on it
Projects
None yet
Development

No branches or pull requests

2 participants