method
to_time
v2_6_3 -
Show latest stable
- Class:
DateTime
to_time()public
Returns a Time object which denotes self.
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;
}
} Related methods
- Instance methods
- as_json
- hour
- iso8601
- jisx0301
- min
- minute
- new_offset
- offset
- rfc3339
- sec
- sec_fraction
- second
- second_fraction
- strftime
- to_date
- to_datetime
- to_json
- to_s
- to_time
- xmlschema
- zone
- Class methods
- _strptime
- civil
- commercial
- httpdate
- iso8601
- jd
- jisx0301
- json_create
- new
- now
- nth_kday
- ordinal
- parse
- rfc2822
- rfc3339
- rfc822
- strptime
- weeknum
- xmlschema