Updated time regexp.

Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
This commit is contained in:
Nolan Darilek 2009-09-22 08:19:08 -05:00 committed by Marcos Tapajós
parent 3724a33de6
commit 62db7853c3

View file

@ -4,7 +4,7 @@ require File.join(File.dirname(__FILE__), '..', 'more', 'property')
class Time class Time
# returns a local time value much faster than Time.parse # returns a local time value much faster than Time.parse
def self.mktime_with_offset(string) def self.mktime_with_offset(string)
string =~ /(\d{4})\/(\d{2})\/(\d{2}) (\d{2}):(\d{2}):(\d{2}) ([\+\-])(\d{2})/ string =~ /(\d{4})[\-|\/](\d{2})[\-|\/](\d{2})[T|\s](\d{2}):(\d{2}):(\d{2})([\+|\s|\-])*(\d{2}):?(\d{2})/
# $1 = year # $1 = year
# $2 = month # $2 = month
# $3 = day # $3 = day