parse

Date.parse(string='-4712-01-01'[, comp=true[, start=ITALY]]) â date
Class Public methods

Parses the given representation of date and time, and creates a date object. This method does not function as a validator.

If the optional second argument is true and the detected year is in the range â00â to â99â, considers the year a 2-digit form and makes it full.

Date.parse('2001-02-03')          #=> #<Date: 2001-02-03 ...>
Date.parse('20010203')            #=> #<Date: 2001-02-03 ...>
Date.parse('3rd Feb 2001')        #=> #<Date: 2001-02-03 ...>
doc_ruby_on_rails
2015-04-02 11:12:07
Comments
Leave a Comment

Please login to continue.