$ pry
[1] pry(main)> require 'active_support'
=> true
[2] pry(main)> require 'active_support/core_ext'
=> true
[3] pry(main)> str = '2015-01-01 00:00:00 +0900'
=> "2015-01-01 00:00:00 +0900"
[4] pry(main)> now = Time.now.in_time_zone('Asia/Tokyo')
=> Sun, 18 Jan 2015 17:13:35 JST +09:00
[5] pry(main)> (now - Time.parse(str)) <= 7.days
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
11