Closed kassiansun closed 3 years ago
Thank you for the report! This is fixed now.
~/gh/araddon/dateparse/dateparse$ ./dateparse "Sun, 3 Jan 2021 00:12:23 +0800 (GMT+08:00)"
Your Current time.Local zone is PST
Layout String: dateparse.ParseFormat() => Mon, 2 Jan 2006 15:04:05 -0700
+-------------+-----------------------+---------------------------------+-------------------------------------+
| method | Zone Source | Parsed | Parsed: t.In(time.UTC) |
+-------------+-----------------------+---------------------------------+-------------------------------------+
| ParseAny | time.Local = nil | 2021-01-03 00:12:23 +0800 +0800 | 2021-01-02 16:12:23 +0000 UTC day=6 |
| ParseAny | time.Local = time.UTC | 2021-01-03 00:12:23 +0800 +0800 | 2021-01-02 16:12:23 +0000 UTC day=6 |
| ParseIn | time.Local = nil | 2021-01-03 00:12:23 +0800 +0800 | 2021-01-02 16:12:23 +0000 UTC |
| ParseIn | time.Local = time.UTC | 2021-01-03 00:12:23 +0800 +0800 | 2021-01-02 16:12:23 +0000 UTC |
| ParseLocal | time.Local = nil | 2021-01-03 00:12:23 +0800 +0800 | 2021-01-02 16:12:23 +0000 UTC |
| ParseLocal | time.Local = time.UTC | 2021-01-03 00:12:23 +0800 +0800 | 2021-01-02 16:12:23 +0000 UTC |
| ParseStrict | time.Local = nil | 2021-01-03 00:12:23 +0800 +0800 | 2021-01-02 16:12:23 +0000 UTC |
| ParseStrict | time.Local = time.UTC | 2021-01-03 00:12:23 +0800 +0800 | 2021-01-02 16:12:23 +0000 UTC |
+-------------+-----------------------+---------------------------------+-------------------------------------+
Error message is
parsing time "Mon, 4 Jan 2021 17:17:34 +0800 (GM" as "Mon, 2 Jan 2006 15:04:05 -07:00(GM": cannot parse "+0800 (GM" as "-07:00"