Skip to content

Commit

Permalink
Update ZonedDateTime constructor to clarify behaviour when from_utc=f…
Browse files Browse the repository at this point in the history
…alse
  • Loading branch information
iamed2 authored Nov 10, 2021
1 parent e0a66bf commit e881857
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/types/zoneddatetime.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ end
ZonedDateTime(dt::DateTime, tz::TimeZone; from_utc=false) -> ZonedDateTime
Construct a `ZonedDateTime` by applying a `TimeZone` to a `DateTime`. When the `from_utc`
keyword is true the given `DateTime` is assumed to be in UTC instead of in local time and is
converted to the specified `TimeZone`. Note that when `from_utc` is true the given
`DateTime` will always exists and is never ambiguous.
keyword is true the given `DateTime` is assumed to be in UTC and is converted to the specified
`TimeZone`. When `from_utc` is false the given `DateTime` is assumed to already be in the
specified `TimeZone`. Note that when `from_utc` is true the given `DateTime` will always exist
and is never ambiguous.
"""
function ZonedDateTime(dt::DateTime, tz::VariableTimeZone; from_utc::Bool=false)
# Note: Using a function barrier which reduces allocations
Expand Down

0 comments on commit e881857

Please sign in to comment.