ruby-changes:62368
From: S.H <ko1@a...>
Date: Thu, 23 Jul 2020 11:35:34 +0900 (JST)
Subject: [ruby-changes:62368] afacf85e44 (master): Merge pull request #3352 from S-H-GAMELINKS/bug/17042-strftime
https://git.ruby-lang.org/ruby.git/commit/?id=afacf85e44 From afacf85e443cc64dd41c248659b65476434b4175 Mon Sep 17 00:00:00 2001 From: "S.H" <gamelinks007@g...> Date: Thu, 23 Jul 2020 11:35:20 +0900 Subject: Merge pull request #3352 from S-H-GAMELINKS/bug/17042-strftime Fix Time#strftime with timezone [Bug #17042] diff --git a/time.c b/time.c index 8d72068..e993d78 100644 --- a/time.c +++ b/time.c @@ -5109,6 +5109,10 @@ time_strftime(VALUE time, VALUE format) https://github.com/ruby/ruby/blob/trunk/time.c#L5109 VALUE tmp; GetTimeval(time, tobj); + if (tobj->vtm.yday == 0) { + VALUE zone = tobj->vtm.zone; + if (!NIL_P(zone)) zone_localtime(zone, time); + } MAKE_TM(time, tobj); StringValue(format); if (!rb_enc_str_asciicompat_p(format)) { -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/