diff options
| author | Alberto Donizetti <alb.donizetti@gmail.com> | 2018-06-24 13:42:59 +0200 |
|---|---|---|
| committer | Alberto Donizetti <alb.donizetti@gmail.com> | 2018-08-21 22:47:11 +0000 |
| commit | 2ce8411239212b80a0d266dc123bb5b1ec84d211 (patch) | |
| tree | 2bf46f24eba08f052460e90562bb4d9a99ca5b63 /src/encoding | |
| parent | 1ae2eed0b22023cc06ad7f1a82d2df2b6877b14b (diff) | |
| download | go-2ce8411239212b80a0d266dc123bb5b1ec84d211.tar.xz | |
time: accept anything between -23 and 23 as offset namezone name
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/120558
Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/encoding')
0 files changed, 0 insertions, 0 deletions
