You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The naming of "standard" is unfortunate, because it looks like something one might reach for when they need a default. In reality, this can never be defaulted, because it is the result of a TZDB calculation. Defaulting to one can produce results that are not just incomprehensible but actually wrong, like showing 8pm instead of 7pm. It is therefore our duty as API designers to prevent programmers from using Standard when they need a default value.
Typically not requiring a variant, instead allowing it to be omitted or passed as an Option
However, we should try to do better.
I think we're stuck with the status quo for 2.0, but we should consider in 3.0 whether we want to adopt new names, such as:
// Option 0: Status quo// Pro: Consistent with US time zone naming conventions// Con: Misleading names that are wrong for e.g. Irish Standard Time// Con: The name "standard" sounds like it wants to be a defaultpubenumTimeZoneVariant{Standard,Daylight,}// Option 1: Season-based// Pro: Easy to understand; almost always correct, even in Ireland// Con: Doesn't work in Morocco which uses Summer time year-round// except during RamadanpubenumTimeZoneVariant{WinterOrYearRound,Summer,}// Option 2: Offset-based// Pro: Always correct, precisely reflects the CLDR definition// Con: Hard to understandpubenumTimeZoneVariant{LowerOffset,HigherOffset,}// Option 3: Sunrise-based// Pro: Somewhat easy to understand// Con: Could be confusing since sunrise in Summer is earlier than in Winter// despite using the LaterSunrise variantpubenumTimeZoneVariant{EarlierSunrise,LaterSunrise,}// Option 4: Meridian-based// Pro: Somewhat easy to understand// Con: What is a meridian?pubenumTimeZoneVariant{EarlierMeridian,LaterMeridian,}
They are currently
StandardandDaylight.The naming of "standard" is unfortunate, because it looks like something one might reach for when they need a default. In reality, this can never be defaulted, because it is the result of a TZDB calculation. Defaulting to one can produce results that are not just incomprehensible but actually wrong, like showing 8pm instead of 7pm. It is therefore our duty as API designers to prevent programmers from using
Standardwhen they need a default value.In Rust, we've done this in two ways:
However, we should try to do better.
I think we're stuck with the status quo for 2.0, but we should consider in 3.0 whether we want to adopt new names, such as:
@robertbastian @Manishearth