module Stardate::SFloat

Public Instance Methods

to_time() click to toggle source
# File lib/stardate.rb, line 33
def to_time
  y = 1000
  s = (y / YEAR_DURATION / 24 / 3600)
  stardate = self.round(1) - BASE_DATE.stardate
  year = (stardate / y).to_i
  seconds = ((stardate - (year * 1000)) / s).to_i
  Time.new(year + BASE_DATE.year) + seconds.seconds
end