wday()
public
Returns an integer representing the day of the
week, 0..6, with Sunday == 0.
t = Time.now
t.wday
Show source
/*
* call-seq:
* time.wday => fixnum
*
* Returns an integer representing the day of the week, 0..6, with
* Sunday == 0.
*
* t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003
* t.wday #=> 3
*/
static VALUE
time_wday(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_wday);
}