Module: StringToDatetimeForSoap

Defined in:
lib/action_web_service/string_to_datetime_for_soap.rb

Instance Method Summary collapse

Instance Method Details

#to_datetimeObject



2
3
4
5
6
7
# File 'lib/action_web_service/string_to_datetime_for_soap.rb', line 2

def to_datetime
  if /^([+\-]?\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d(?:\.(\d*))?)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ self.strip
    return Time.xmlschema(self).localtime
  end
  super
end