aboutsummaryrefslogtreecommitdiffstats
path: root/ext/date/date_core.c
diff options
context:
space:
mode:
authorsonots <sonots@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-18 01:26:12 +0000
committersonots <sonots@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-18 01:26:12 +0000
commit5f11a6eb6cca740b08384d1e4a68df643d98398c (patch)
tree8e7df5afcda0c95f2abd1a21d525988b9eb94666 /ext/date/date_core.c
parentf8e79c84a90bfa32d4dd00f7d5db756239b084b7 (diff)
downloadruby-5f11a6eb6cca740b08384d1e4a68df643d98398c.tar.gz
* ext/date/date_core.c (datetime_to_time): preserve timezone info
[Bug #12189] [Fix GH-1295] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/date/date_core.c')
-rw-r--r--ext/date/date_core.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index 64f19e4d54..0b4611a8f7 100644
--- a/ext/date/date_core.c
+++ b/ext/date/date_core.c
@@ -8587,21 +8587,24 @@ date_to_datetime(VALUE self)
static VALUE
datetime_to_time(VALUE self)
{
- volatile VALUE dup = dup_obj_with_new_offset(self, 0);
+ volatile VALUE dup = dup_obj(self);
{
VALUE t;
get_d1(dup);
- t = f_utc6(rb_cTime,
+ t = rb_funcall(rb_cTime,
+ rb_intern("new"),
+ 7,
m_real_year(dat),
INT2FIX(m_mon(dat)),
INT2FIX(m_mday(dat)),
INT2FIX(m_hour(dat)),
INT2FIX(m_min(dat)),
f_add(INT2FIX(m_sec(dat)),
- m_sf_in_sec(dat)));
- return f_getlocal(t);
+ m_sf_in_sec(dat)),
+ INT2FIX(m_of(dat)));
+ return t;
}
}