• Alberto Donizetti's avatar
    time: accept anything between -23 and 23 as offset namezone name · 2ce84112
    Alberto Donizetti authored
    time.Parse currently rejects numeric timezones names with UTC offsets
    bigger than +12, but this is incorrect: there's a +13 timezone and a
    +14 timezone:
    
      $ zdump Pacific/Kiritimati
      Pacific/Kiritimati  Mon Jun 25 02:15:03 2018 +14
    
    For convenience, this cl changes the ranges of accepted offsets from
    -14..+12 to -23..+23 (zero still excluded), i.e. every possible offset
    that makes sense. We don't validate three-letter abbreviations for the
    timezones names, so there's no need to be too strict on numeric names.
    
    This change also fixes a bug in the parseTimeZone, that is currently
    unconditionally returning true (i.e. valid timezone), without checking
    the value returned by parseSignedOffset.
    
    This fixes 5 of 17 time.Parse() failures listed in Issue #26032.
    
    Updates #26032
    
    Change-Id: I2f08ca9aa41ea4c6149ed35ed2dd8f23eeb42bff
    Reviewed-on: https://go-review.googlesource.com/120558Reviewed-by: 's avatarRob Pike <r@golang.org>
    2ce84112
Name
Last commit
Last update
..
example_test.go Loading commit data...
export_android_test.go Loading commit data...
export_test.go Loading commit data...
export_windows_test.go Loading commit data...
format.go Loading commit data...
format_test.go Loading commit data...
genzabbrs.go Loading commit data...
internal_test.go Loading commit data...
mono_test.go Loading commit data...
sleep.go Loading commit data...
sleep_test.go Loading commit data...
sys_plan9.go Loading commit data...
sys_unix.go Loading commit data...
sys_windows.go Loading commit data...
tick.go Loading commit data...
tick_test.go Loading commit data...
time.go Loading commit data...
time_test.go Loading commit data...
zoneinfo.go Loading commit data...
zoneinfo_abbrs_windows.go Loading commit data...
zoneinfo_android.go Loading commit data...
zoneinfo_android_test.go Loading commit data...
zoneinfo_ios.go Loading commit data...
zoneinfo_plan9.go Loading commit data...
zoneinfo_read.go Loading commit data...
zoneinfo_test.go Loading commit data...
zoneinfo_unix.go Loading commit data...
zoneinfo_windows.go Loading commit data...
zoneinfo_windows_test.go Loading commit data...