1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

1.4.1 to be

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 1999-08-24 08:21:56 +00:00
parent a281c99668
commit a1b57d0add
32 changed files with 211 additions and 435 deletions

View file

@ -27,7 +27,7 @@ module ParseDate
if date.sub!(/(#{DAYPAT})[a-z]*,?/i, ' ')
wday = DAYS[$1.downcase]
end
if date.sub!(/(\d+):(\d+)(?::(\d+))?\s*(am|pm)?\s*(?:\s+([a-z]{1,4}(?:\s+[a-z]{1,4})?|[-+]\d{4}))?/i, ' ')
if date.sub!(/(\d+):(\d+)(?::(\d+))?(?:\s*(am|pm))?(?:\s+([a-z]{1,4}(?:\s+[a-z]{1,4})?|[-+]\d{4}))?/i, ' ')
hour = $1.to_i
min = $2.to_i
if $3
@ -62,6 +62,16 @@ module ParseDate
mday = $1.to_i
mon = MONTHS[$2.downcase]
year = $3.to_i
elsif date.sub!(/(\d+)-(#{MONTHPAT})-(\d+)/i, ' ')
mday = $1.to_i
mon = MONTHS[$2.downcase]
year = $3.to_i
end
p date
if date.sub!(/\d{4}/i, ' ')
year = $&.to_i
elsif date.sub!(/\d\d/i, ' ')
year = $&.to_i
end
if guess
if year < 100
@ -71,10 +81,6 @@ module ParseDate
year += 2000
end
end
elsif date.sub!(/(\d+)-(#{MONTHPAT})-(\d+)/i, ' ')
mday = $1.to_i
mon = MONTHS[$2.downcase]
year = $3.to_i
end
return year, mon, mday, hour, min, sec, zone, wday
end