Subtract 61 days from a date: : Date Calculation « Date « Ruby






Subtract 61 days from a date:


require 'date'

date = Date.new( 2006, 11, 8 )

puts (date - 61).to_s 

 








Related examples in the same category

1.Add and subtract six months using the >> and << methods.
2.Doing Date Arithmetic
3.Doing DateTime Arithmetic
4.Minus one DateTime from another
5.Move DateTime
6.leap year day
7.Counting the Days Since an Arbitrary Date
8.advent calendar
9.Minus DateTime by day
10.Remaining days