Open scls19fr opened 4 years ago
At the moment equality between FixedTimeZone
s compares the name, standard time offset, and daylight saving time offset.
julia> x = FixedTimeZone("", 3600)
UTC+01:00
julia> y = tz"UTC+01:00"
UTC+01:00
julia> x == y
false
julia> x.offset == y.offset
true
I'll need to look further into why we use the name as part of the comparison but there is an argument to be made for just comparing the offsets only.
As for creating a time zone from a number of seconds I would just do FixedTimeZone("", secs)
like you were doing. If you really want equality to work to some degree you could do:
julia> secs = 3600
3600
julia> x = FixedTimeZone("UTC" * TimeZones.offset_string(Second(secs), true), Second(secs))
UTC+01:00
julia> x == tz"UTC+01"
true
We could even add this as an additional constructor to FixedTimeZone
.
I'm wondering if building FixedTimeZone
from Minute
shouldn't be considered.
Anyway additional constructor to FixedTimeZone should be considered.
Hello,
I'm wondering why
I'm looking for a way to get a time zone offset from a number of second
Any idea?