In ruby I am using DateTime.now.next_year.to_time
to get the time and date of a day one year from now. This now needs to be changed to 10 years. How can I do this.
This seems to work:
DateTime.now.next_year(10).to_time
#=> 2027-04-14 20:40:38 +0000
Accepts negative numbers too and does what you'd expect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With