From 296a2cab07ce530809ee74dee61180fbb3ca6f91 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 16 Feb 2021 19:36:20 +0900 Subject: Parse "-00:00" as UTC for the round-trip [Feature #17544] --- time.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'time.c') diff --git a/time.c b/time.c index 050a52615f..bd79110c5e 100644 --- a/time.c +++ b/time.c @@ -2150,8 +2150,10 @@ utc_offset_arg(VALUE arg) if (s[0] != '+' && s[0] != '-') goto invalid_utc_offset; if (!ISDIGIT(s[1]) || !ISDIGIT(s[2])) goto invalid_utc_offset; n += (s[1] * 10 + s[2] - '0' * 11) * 3600; - if (s[0] == '-') + if (s[0] == '-') { + if (n == 0) return UTC_ZONE; n = -n; + } return INT2FIX(n); } else { -- cgit v1.2.3