1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Merge pull request #3352 from S-H-GAMELINKS/bug/17042-strftime

Fix Time#strftime with timezone [Bug #17042]
This commit is contained in:
S.H 2020-07-23 11:35:20 +09:00 committed by GitHub
parent 8ed687a4d7
commit afacf85e44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: git 2020-07-23 11:35:43 +09:00
Merged-By: nobu <nobu@ruby-lang.org>

4
time.c
View file

@ -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)) {