= private = protected
inspect()
Returns a string representing time. Equivalent to calling Time#strftime with a format string of “%Y-%m-%d %H:%M:%S %z” for a local time and “%Y-%m-%d %H:%M:%S UTC” for a UTC time.
Time.now.to_s #=> "2007-10-05 16:09:51 +0900" Time.now.utc.to_s #=> "2007-10-05 07:09:51 UTC"
static VALUE time_to_s(VALUE time) { struct time_object *tobj; GetTimeval(time, tobj); if (TIME_UTC_P(tobj)) return strftimev("%Y-%m-%d %H:%M:%S UTC", time); else return strftimev("%Y-%m-%d %H:%M:%S %z", time); }