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:
parent
8ed687a4d7
commit
afacf85e44
Notes:
git
2020-07-23 11:35:43 +09:00
Merged-By: nobu <nobu@ruby-lang.org>
1 changed files with 4 additions and 0 deletions
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…
Add table
Reference in a new issue