-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
at(dt::DateTime, t::Time) and at(d::Date, t::Time) #24814
Labels
Comments
Here is a possible implementation julia> DateTime(d::Date, t::Dates.Time) = d + t
DateTime (generic function with 1 method)
julia> at(d::Dates.TimeType, t::Dates.Time) = DateTime(Date(d), t)
at (generic function with 1 method)
julia> dt = Dates.DateTime(2010, 1, 3, 20, 30)
2010-01-03T20:30:00
julia> d = Date(dt)
2010-01-03
julia> t = Dates.Time(dt)
20:30:00
julia> t2 = Dates.Time(22, 30)
22:30:00
julia> println(at(d, t2))
2010-01-03T22:30:00
julia> println(at(dt, t2))
2010-01-03T22:30:00 I hope that (one day) function chaining issue will be fixed #5571 d.at(t) or d |> at(t) or (but not my prefered syntaxic sugar) d |> at(_, t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Hello,
Julia now have a Time type thanks to @aviks issue #12140 and @quinnj PR #12274
but a function that returns DateTime at a given Time (from either a Date or a DateTime)
could be a nice feature to have.
Usage example :
with DateTime
with Date
This is a bit out of the scope of this issue but creating a DateTime from Date and Time is not as easy as it should be
Kind regards
The text was updated successfully, but these errors were encountered: