about time compare

I have a submmited date param whose data type is date and want to use
the Time object and the date param to judge if the date param passes the
today. I use the following codes judging:
#########
date.yday-Time.now.yday<0
##########

why not just date < Time.now ?

Fred

why not just date < Time.now ?

Fred

I just want to compare the year,month,and day,but Time.now includes the
miniute

why not just date < Time.now ?

Fred

I just want to compare the year,month,and day,but Time.now includes
the
miniute

You could use the to_date method to compare the actual dates (or use
change(:hour =>0) which discard the hour minute and seconds components)

Fred

You could use the to_date method to compare the actual dates (or use
change(:hour =>0) which discard the hour minute and seconds components)

Fred

Thank you very much!