зеркало из https://github.com/github/ruby.git
21 строка
476 B
Ruby
21 строка
476 B
Ruby
# parsedate.rb: Written by Tadayoshi Funaba 2001, 2002
|
|
# $Id: parsedate.rb,v 2.6 2002-05-14 07:43:18+09 tadf Exp $
|
|
|
|
require 'date/format'
|
|
|
|
module ParseDate
|
|
|
|
def parsedate(str, comp=false)
|
|
Date._parse(str, comp).
|
|
values_at(:year, :mon, :mday, :hour, :min, :sec, :zone, :wday)
|
|
end
|
|
|
|
|
|
def strptime(str, format)
|
|
Date._strptime(str, format).
|
|
values_at(:year, :mon, :mday, :hour, :min, :sec, :zone, :wday)
|
|
end
|
|
|
|
module_function :parsedate, :strptime
|
|
end
|