Merge pull request #3352 from S-H-GAMELINKS/bug/17042-strftime
Fix Time#strftime with timezone [Bug #17042]
This commit is contained in:
parent
8ed687a4d7
commit
afacf85e44
Notes:
git
2020-07-23 11:35:43 +09:00
Merged-By: nobu <nobu@ruby-lang.org>
4
time.c
4
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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user