summaryrefslogtreecommitdiff
path: root/lib/time.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-29 06:39:50 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-29 06:39:50 +0000
commit0977fe17053680310cb0611e9ad2df705d05a070 (patch)
tree193303ea0a80ff3afab2278ad36cb60b1353fe2a /lib/time.rb
parentfec60bc7c4f851d0cf1c4670ef8f2d9c597b7598 (diff)
* 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
Diffstat (limited to 'lib/time.rb')
-rw-r--r--lib/time.rb8
1 files changed, 4 insertions, 4 deletions
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