method

tz2of

ruby latest stable - Class: XSD::XSDDateTimeImpl

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1_8_7_330) is shown here.

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