method

strptime

v1_9_2_180 - Show latest stable - Class: Date
strptime(str='-4712-01-01', fmt='%F', sg=ITALY)
public

Create a new Date object by parsing from a String according to a specified format.

str is a String holding a date representation. fmt is the format that the date is in. See date/format.rb for details on supported formats.

The default str is ‘-4712-01-01’, and the default fmt is ‘%F’, which means Year-Month-Day_of_Month. This gives Julian Day Number day 0.

sg specifies the Day of Calendar Reform.

An ArgumentError will be raised if str cannot be parsed.

1Note

Uses same arguments as Time#strftime

vosechu · Jun 28, 20111 thank

I believe this uses the same parsing format as strftime.

http://apidock.com/ruby/Time/strftime