sec()
public
Returns the second of the minute (0..60)[Yes, seconds really can range
from zero to 60. This allows the system to inject leap seconds every now and then to correct for the fact that
years are not really a convenient number of hours long.] for
time.
t = Time.now
t.sec
Show source
/*
* call-seq:
* time.sec => fixnum
*
* Returns the second of the minute (0..60)<em>[Yes, seconds really can
* range from zero to 60. This allows the system to inject leap seconds
* every now and then to correct for the fact that years are not really
* a convenient number of hours long.]</em> for <i>time</i>.
*
* t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003
* t.sec #=> 4
*/
static VALUE
time_sec(time)
VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
if (tobj->tm_got == 0) {
time_get_tm(time, tobj->gmt);
}
return INT2FIX(tobj->tm.tm_sec);
}