Module: TomlRB::LocalTimeParser

Defined in:
lib/toml-rb/datetime.rb

Instance Method Summary collapse

Instance Method Details

#valueObject



31
32
33
34
35
36
# File 'lib/toml-rb/datetime.rb', line 31

def value
  hour, min, sec, sec_frac = captures[:time_skeleton].first.value
  usec = sec_frac.to_s.ljust(6, '0')

  Time.at(3600 * hour.to_i + 60 * min.to_i + sec.to_i, usec.to_i)
end