-
Notifications
You must be signed in to change notification settings - Fork 54
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
Should FixedTimeZones have names? #326
Comments
As |
This is true.
would instread show up as:
The benifit is we would be saving 1 pointer (4 or 8 bytes depending on 32 or 64 bit) + about 16 bytes of content from every FixedTimeZone. julia> length(tz"America/New_York".transitions)
237
julia> length(tz"America/Winnipeg".transitions)
187
julia> length(tz"Australia/Perth".transitions)
20 as well as making it In contrast, making it |
I agree we can do better but I'd rather not lose information that is part of the tzdata. There are a few alternate ways we could be storing this data. One of these is the tzfile format which TimeZones.jl already supports reading. Additionally, the abbreviations used by transitions "Use three to six characters that are ASCII alphanumerics or '+' or '-'." |
Relating to #271 , if we removed the
name
field from theFixedTimeZone
type then it would beisbits
.And would use a bit less memory.
RIght now, as I understand the situation:
FixedTimeZone(name)
: actually discards the name you pass it. It pulls out the key information to determine the offset, and then constructs a new name in standard form ofUTC±HH:MM[:SS]
FixedTimeZone(name, offset, dst_offset)
keeps the name.FixedTimeZone("UTC") != FixedTimeZone("Z", 0)
FixedTimeZone
s. It does for VariableTimeZones, since they might vary later even if transitions and offset are same nowUTC±HH:MM[:SS]
for purposes of displayingrename
ed to generate a newFixedTimeZone
with same offset but different nameThe text was updated successfully, but these errors were encountered: