LoginSignup
2
2

More than 5 years have passed since last update.

時刻のフォーマットをiso8601形式にする

Last updated at Posted at 2014-11-05

こんな感じ。ActiveSupportを使った場合も同じようにできます。

require 'time'

Time.now.iso8601
=> "2014-11-05T21:45:10+09:00"

7.days.ago.iso8601
=> "2014-10-29T21:46:04+09:00"

しかし、ActiveSupport便利!

参考記事

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2