LoginSignup
1
1

More than 3 years have passed since last update.

Date.today.since(7.days) ←7日後

Posted at

何日後:since

何日前:ago

どちらも`Dateクラスが持っているメソッドである。

[1] pry(main)> Date.today
=> Tue, 08 Oct 2019

[2] pry(main)> Date.today.since(3.days)
=> Fri, 11 Oct 2019 00:00:00 JST +09:00

[3] pry(main)> Date.today.ago(3.days)
=> Sat, 05 Oct 2019 00:00:00 JST +09:00
1
1
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
1
1