how to compare particular date with today to know whether that paricular date is greater than today
Thanks Harish.
how to compare particular date with today to know whether that paricular date is greater than today
Thanks Harish.
If you're using date objects, you just compare as expected.
date1 > date2
@date = "2010-07-20".to_date # 20th July
@today=Date.today # 21st July
if @date >= @today
puts "@date is greater than or equal to today's date"
else
puts "@date is less than today's date"
end
O/P
@date is less than today's date
date
object has future?
and past?
methods. It's the best way I can think of.