yday()
public
Returns an integer representing the day of the
year, 1..366.
t = Time.now
t.yday
Show source
/*
* call-seq:
* time.yday => fixnum
*
* Returns an integer representing the day of the year, 1..366.
*
* t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003
* t.yday #=> 99
*/
static VALUE
time_yday(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_yday+1);
}