From afacf85e443cc64dd41c248659b65476434b4175 Mon Sep 17 00:00:00 2001 From: "S.H" 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] --- time.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'time.c') diff --git a/time.c b/time.c index 8d7206824b..e993d785a5 100644 --- a/time.c +++ b/time.c @@ -5109,6 +5109,10 @@ time_strftime(VALUE time, VALUE format) 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 v1.2.3