method
tz2of
v1_8_6_287 -
Show latest stable
- Class:
XSD::XSDDateTimeImpl
tz2of(str)public
No documentation available.
# File lib/xsd/datatypes.rb, line 534
def tz2of(str)
/^(?:Z|(?:([+\-])(\d\d):(\d\d))?)$/ =~ str
sign = $1
hour = $2.to_i
min = $3.to_i
of = case sign
when '+'
of = +(hour.to_r * 60 + min) / 1440 # 24 * 60
when '-'
of = -(hour.to_r * 60 + min) / 1440 # 24 * 60
else
0
end
of
end