method

tz2of

Importance_0
v1_8_6_287 - Show latest stable - 0 notes - Class: XSD::XSDDateTimeImpl
tz2of(str) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# 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
Register or log in to add new notes.