utc?()
public
Returns true if time represents a time in UTC (GMT).
t = Time.now
t.utc?
t = Time.gm(2000,"jan",1,20,15,1)
t.utc?
t = Time.now
t.gmt?
t = Time.gm(2000,1,1,20,15,1)
t.gmt?
Show source
/*
* call-seq:
* time.utc? => true or false
* time.gmt? => true or false
*
* Returns <code>true</code> if <i>time</i> represents a time in UTC
* (GMT).
*
* t = Time.now #=> Wed Apr 09 08:56:04 CDT 2003
* t.utc? #=> false
* t = Time.gm(2000,"jan",1,20,15,1) #=> Sat Jan 01 20:15:01 UTC 2000
* t.utc? #=> true
*
* t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003
* t.gmt? #=> false
* t = Time.gm(2000,1,1,20,15,1) #=> Sat Jan 01 20:15:01 UTC 2000
* t.gmt? #=> true
*/
static VALUE
time_utc_p(time)
VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
if (tobj->gmt) return Qtrue;
return Qfalse;
}