require 'date'
begin
Date.parse("31-02-2010")
rescue ArgumentError
# handle invalid date
end
More Related Contents:
- In Ruby on Rails, how do I format a date with the “th” suffix, as in, “Sun Oct 5th”?
- Test if string is a number in Ruby on Rails
- How do I validate a date in rails?
- Converting camel case to underscore case in ruby
- Rails formatting date
- Find number of months between two Dates in Ruby on Rails
- Converting string from snake_case to CamelCase in Ruby
- How to URL encode a string in Ruby
- OO Design in Rails: Where to put stuff
- How to extract URL parameters from a URL with Ruby or Rails?
- ruby/ruby on rails memory leak detection
- How can I uninstall Ruby on ubuntu?
- How do I ‘validate’ on destroy in rails
- How do i work with two different databases in rails with active records?
- Using Rails Migration on different database than standard “production” or “development”
- Rails Console: reload! not reflecting changes in model files? What could be possible reason?
- How would you parse a url in Ruby to get the main domain?
- no such file to load — readline
- counter_cache with has_many :through
- Heroku not sending email with Gmail SMTP
- How can I specify a local gem in my Gemfile?
- How to set default values in Rails?
- What is the right way to override a setter method in Ruby on Rails?
- How do I use gems with Ubuntu?
- “gem install rails” fails with DNS error
- Why is respond_with being removed from rails 4.2 into it’s own gem?
- Rails devise: user_signed_in? not working
- Customizing Devise error messages in Rails 3?
- How do I use CSS with a ruby on rails application?
- Rails Object Relationships and JSON Rendering