Ruby 1.8.7 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Timeクラス > to_s

instance method Time#to_s

to_s -> String

時刻を date(1) のような形式の文字列に変換します。

self.strftime("%a %b %d %H:%M:%S %Z %Y")

と同じです。

p Time.now.to_s # => "Mon Oct 20 06:02:10 JST 2003"
class Time