module Nmea::UtcTimeable

Protected Instance Methods

hhmmss_to_local_time(text) click to toggle source
# File lib/nmea_gps.rb, line 16
def hhmmss_to_local_time(text)
  hh, mm, ss = text.chars.each_slice(2).collect{|chars| chars.join }
  Time.zone = "UTC"
  utc_today = Time.zone.today
  Time.zone.local(utc_today.year, utc_today.month, utc_today.day, hh, mm, ss).
    in_time_zone(Nmea::Config.time_zone)
end