Skip to content
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

improve STDOFF and DST offsets to handle one minute resolution #18

Closed
bxparks opened this issue Aug 15, 2019 · 0 comments
Closed

improve STDOFF and DST offsets to handle one minute resolution #18

bxparks opened this issue Aug 15, 2019 · 0 comments

Comments

@bxparks
Copy link
Owner

bxparks commented Aug 15, 2019

Currently (v0.7.2), the AT and UNTIL times are handled with one-minute resolution. But the STDOFF and DST offsets (in RULES column with 'hh:mm' and SAVE column) are handled using a 15-minute resolution. The 15-minute resolution is sufficient for all timezones after the year 2000, but if we want to support historical DST shifts before year 2000, then we need to support one-minute resolution.

An example is Pacific/Kiritimati which used a UTC offset of -10:40 from 1901 to 1979:

# Zone  NAME            STDOFF  RULES   FORMAT  [UNTIL]
Zone Pacific/Kiritimati -10:29:20 -     LMT     1901
                        -10:40  -       -1040   1979 Oct                        
                        -10:00  -       -10 

If we go very far back, there are a number of timezones which have UTC offsets in one-second resolution. Because I want to keep the zoneinfo files as small as possible, I don't think these will be supported. For curiosity, here is the output from tzcompiler.py if we ask it to truncate the offsets to 1-minute resolution, for the years 1935 - 2050:

// Africa/El_Aaiun (STDOFF '-0:52:48' truncated to '-00:52')
// Africa/Johannesburg (RULES not fixed but FORMAT is missing '%' or '/')
// Africa/Monrovia (STDOFF '-0:44:30' truncated to '-00:44')
// America/Goose_Bay (STDOFF '-3:30:52' truncated to '-03:30')
// America/Managua (STDOFF '-5:45:12' truncated to '-05:45')
// America/Paramaribo (STDOFF '-3:40:36' truncated to '-03:40', STDOFF '-3:40:52' truncated to '-03:40')
// America/St_Johns (STDOFF '-3:30:52' truncated to '-03:30')
// Asia/Dhaka (STDOFF '5:53:20' truncated to '05:53')
// Asia/Riyadh (STDOFF '3:06:52' truncated to '03:06')
// Asia/Tehran (STDOFF '3:25:44' truncated to '03:25')
// Asia/Thimphu (STDOFF '5:58:36' truncated to '05:58')
// Atlantic/Azores (RULES not fixed but FORMAT is missing '%' or '/')
// Atlantic/Madeira (RULES not fixed but FORMAT is missing '%' or '/')          
// Europe/Amsterdam (STDOFF '0:19:32' truncated to '00:19')
bxparks added a commit that referenced this issue Aug 15, 2019
…Code; WorldClock flash actually goes down 20 bytes (#18)
bxparks added a commit that referenced this issue Aug 16, 2019
…sic:: and extended::, prep for different implementations (#18)
bxparks added a commit that referenced this issue Aug 16, 2019
…coded offsetCode and deltaCode; matches Hinnant date from 1972 to 2050 (#18)
bxparks added a commit that referenced this issue Aug 16, 2019
…ghres encoding that supports 1-minute resolution (#18)
bxparks added a commit that referenced this issue Aug 16, 2019
…d/ database, all timezones, year [1975, 2050), 1-minute resolution (#18)
bxparks added a commit that referenced this issue Aug 16, 2019
@bxparks bxparks closed this as completed Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant