Method: Time#zone
- Defined in:
- time.c
#zone ⇒ String
Returns the string name of the time zone for self:
Time.utc(2000, 1, 1).zone # => "UTC"
Time.new(2000, 1, 1).zone # => "Central Standard Time"
5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 |
# File 'time.c', line 5030 static VALUE time_zone(VALUE time) { struct time_object *tobj; VALUE zone; GetTimeval(time, tobj); MAKE_TM(time, tobj); if (TZMODE_UTC_P(tobj)) { return rb_usascii_str_new_cstr("UTC"); } zone = tobj->vtm.zone; if (NIL_P(zone)) return Qnil; if (RB_TYPE_P(zone, T_STRING)) zone = rb_str_dup(zone); return zone; } |