diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-01-15 17:19:18 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-02-16 20:34:23 +0900 |
commit | 9ef66ce3fcfee06d628b611dbc22026d7cc72d0e (patch) | |
tree | 330848440b82ffbd1a3bcda8e120011693c8175f /strftime.c | |
parent | 4fc6fb2d124b3b122066b82b5d093bf416ab196f (diff) |
strftime.c: support unknown offset UTC in RFC 3339 [Feature #17544]
In RFC 3339, -00:00 is used for the time in UTC is known, but the
offset to local time is unknown. Support that representation by
`-` flag for `z`.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4075
Diffstat (limited to 'strftime.c')
-rw-r--r-- | strftime.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/strftime.c b/strftime.c index f4180fdb9e..88cdb2198c 100644 --- a/strftime.c +++ b/strftime.c @@ -547,7 +547,7 @@ rb_strftime_with_timespec(VALUE ftime, const char *format, size_t format_len, else { off = NUM2LONG(rb_funcall(vtm->utc_offset, rb_intern("round"), 0)); } - if (off < 0) { + if (off < 0 || (off == 0 && (flags & BIT_OF(LEFT)))) { off = -off; sign = -1; } |