summaryrefslogtreecommitdiff
path: root/ext/date/date_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/date/date_core.c')
-rw-r--r--ext/date/date_core.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index da7d82a76a..b93d362bbd 100644
--- a/ext/date/date_core.c
+++ b/ext/date/date_core.c
@@ -8581,24 +8581,21 @@ date_to_datetime(VALUE self)
static VALUE
datetime_to_time(VALUE self)
{
- volatile VALUE dup = dup_obj(self);
+ volatile VALUE dup = dup_obj_with_new_offset(self, 0);
{
VALUE t;
get_d1(dup);
- t = rb_funcall(rb_cTime,
- rb_intern("new"),
- 7,
+ t = f_utc6(rb_cTime,
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)),
- INT2FIX(m_of(dat)));
- return t;
+ m_sf_in_sec(dat)));
+ return f_getlocal(t);
}
}