# Validate two dates, 2date - 1date \> 1month

**URL:** <https://www.ruby-forum.com/t/validate-two-dates-2date-1date-1month/116742>\
**Category:** Rails\
**Created:** [October 9, 2007, 8:44am UTC](https://www.ruby-forum.com/t/validate-two-dates-2date-1date-1month/116742 "2007-10-09T08:44:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![demoversion](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4491bb/32.png) [@demoversion](https://www.ruby-forum.com/u/demoversion)\
**Post date:** [October 9, 2007, 8:44am UTC](https://www.ruby-forum.com/t/validate-two-dates-2date-1date-1month/116742/1 "2007-10-09T08:44:02Z")

</div>

Hello,

I have a model with date field, i need to compare this date with current  
system time. The date that inputed from web-form should be at least one  
month later than current system time.

What the best way to do it?

Thanks

---

<div class="post-metadata">

**Author:** ![demoversion](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4491bb/32.png) [@demoversion](https://www.ruby-forum.com/u/demoversion)\
**Post date:** [October 9, 2007, 8:59am UTC](https://www.ruby-forum.com/t/validate-two-dates-2date-1date-1month/116742/2 "2007-10-09T08:59:06Z")

</div>

I would probably use something like this, assuming you have a Time  
the\_time:

1.month.ago \>= the\_time
