Method: DateTime#to_time

Defined in:
ext/date/date_core.c

#to_timeTime

Returns a Time object which denotes self.

Returns:



8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
# File 'ext/date/date_core.c', line 8703

static VALUE
datetime_to_time(VALUE self)
{
    volatile VALUE dup = dup_obj(self);
    {
  VALUE t;

  get_d1(dup);

  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)),
       INT2FIX(m_of(dat)));
  return t;
    }
}