-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
julia> function utc_to_ny(date_time_utc::DateTime)::ZonedDateTime
date_time_utc = ZonedDateTime(date_time_utc, tz"UTC")
date_time_ny = TimeZones.astimezone(date_time_utc, tz"America/New_York")
return date_time_ny
end
utc_to_ny (generic function with 1 method)
julia> JET.@report_call utc_to_ny(now())
═════ 2 possible errors found ═════
┌ @ REPL[23]:3 date_time_ny = astimezone(date_time_utc, America/New_York)
│┌ @ C:\.julia\packages\TimeZones\V28u7\src\conversions.jl:179 i = Core.kwcall(NamedTuple{(:by,)}(tuple(#24)), TimeZones.searchsortedlast, tz.transitions, zdt.utc_datetime)
││┌ @ sort.jl:285 Base.Sort.:(var"#searchsortedlast#5")(_10, _10, _10, _10, _3, v, x)
│││┌ @ sort.jl:285 searchsortedlast(v, x, Base.Sort.ord(lt, by, rev, order))
││││┌ @ sort.jl:283 searchsortedlast(v, x, Base.Sort.firstindex(v), Base.Sort.lastindex(v), o)
│││││┌ @ sort.jl:189 Base.Sort.lt(o, x, v[m])
││││││┌ @ ordering.jl:119 o.by(a)
│││││││┌ @ C:\.julia\packages\TimeZones\V28u7\src\conversions.jl:181 v.utc_datetime
││││││││┌ @ Base.jl:37 Base.getfield(x, f)
│││││││││ type Dates.DateTime has no field utc_datetime
││││││││└──────────────
││││││┌ @ ordering.jl:119 lt(o.order, o.by(a), o.by(b))
│││││││┌ @ ordering.jl:117 Base.Order.isless(a, b)
││││││││ no matching method found `isless(::DateTime, ::TimeZones.Transition)`: Base.Order.isless(a::DateTime, b::TimeZones.Transition)
│││││││└───────────────────
From JET.jl
Metadata
Metadata
Assignees
Labels
No labels