module Stardate::STime
Public Instance Methods
to_stardate()
click to toggle source
# File lib/stardate.rb, line 23 def to_stardate t1 = self.beginning_of_year t2 = self.beginning_of_day days = (t2 - t1) / 3600 / 24 # days passed since the beginning of the year seconds = self - t2 # seconds passed since the beginning of the day (BASE_DATE.stardate + ((self.year - BASE_DATE.year) + days / YEAR_DURATION + seconds / (YEAR_DURATION * 24 * 3600)) * 1000).round(1) end