inspect

time.inspect â string
Instance Public methods

Returns a string representing time. Equivalent to calling strftime with the appropriate format string.

1
2
3
4
5
6
t = Time.now
t.to_s                              => "2012-11-10 18:16:12 +0100"
t.strftime "%Y-%m-%d %H:%M:%S %z"   => "2012-11-10 18:16:12 +0100"
 
t.utc.to_s                          => "2012-11-10 17:16:12 UTC"
t.strftime "%Y-%m-%d %H:%M:%S UTC"  => "2012-11-10 17:16:12 UTC"
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.