From 0977fe17053680310cb0611e9ad2df705d05a070 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 29 Mar 2003 06:39:50 +0000 Subject: * instruby.rb, ext/extmk.rb, lib/benchmark.rb, lib/cgi.rb, lib/debug.rb, lib/getoptlong.rb, lib/optparse.rb, lib/time.rb, lib/date/format.rb, lib/irb/ruby-lex.rb lib/uri/common.rb: revert escape for `-' in character class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/time.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/time.rb') diff --git a/lib/time.rb b/lib/time.rb index 4c9d8a526e..043257a4d1 100644 --- a/lib/time.rb +++ b/lib/time.rb @@ -69,9 +69,9 @@ class Time def zone_offset(zone, year=Time.now.year) off = nil zone = zone.upcase - if /\A([\-+])(\d\d):?(\d\d)\z/ =~ zone + if /\A([+-])(\d\d):?(\d\d)\z/ =~ zone off = ($1 == '-' ? -1 : 1) * ($2.to_i * 60 + $3.to_i) * 60 - elsif /\A[\-+]\d\d\z/ =~ zone + elsif /\A[+-]\d\d\z/ =~ zone off = zone.to_i * 3600 elsif ZoneOffset.include?(zone) off = ZoneOffset[zone] * 3600 @@ -191,7 +191,7 @@ class Time (\d{2})\s* :\s*(\d{2})\s* (?::\s*(\d{2}))?\s+ - ([+\-]\d{4}| + ([+-]\d{4}| UT|GMT|EST|EDT|CST|CDT|MST|MDT|PST|PDT|[A-IK-Z])/ix =~ date # Since RFC 2822 permit comments, the regexp has no right anchor. day = $1.to_i @@ -277,7 +277,7 @@ class Time T (\d\d):(\d\d):(\d\d) (\.\d*)? - (Z|[+\-]\d\d:\d\d)? + (Z|[+-]\d\d:\d\d)? \s*\z/ix =~ date datetime = [$1.to_i, $2.to_i, $3.to_i, $4.to_i, $5.to_i, $6.to_i] datetime << $7.to_f * 1000000 if $7 -- cgit v1.2.3