Skip to content

Instantly share code, notes, and snippets.

@uiur
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uiur/bbd17568350f62d23264 to your computer and use it in GitHub Desktop.
Save uiur/bbd17568350f62d23264 to your computer and use it in GitHub Desktop.
% rails c
Loading development environment (Rails 4.1.0)
irb(main):001:0> 1.month.ago + 1.month + 1.day
=> Thu, 01 May 2014 06:25:34 UTC +00:00
irb(main):002:0> 1.month.ago + 1.day + 1.month
=> Wed, 30 Apr 2014 06:25:47 UTC +00:00
@uiur
Copy link
Author

uiur commented Apr 30, 2014

なるほど、こういうことか

3/30 -(1.month)-> 4/30 -(1.day)-> 5/1
3/30 -(1.day)-> 3/31 -(1.month)-> 4/30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment