lib/darian_calendar.rb
# Returns the total number of martian sols for an earth date or time
# @param earth_date_time [Date/Time] Earth date or time
# @return [Float] number of sols
Returns the total number of martian sols for an earth date or time
Returns the total number of martian sols for an earth date or time
def sols_from_earth(earth_date_time)
      seconds = earth_date_time.is_a?(::Date) ? earth_date_time.strftime("%s").to_f : earth_date_time.to_f
      days = (seconds / SECONDS_A_DAY) + E_DAYS_TIL_UNIX
      sols = (days - EPOCH_OFFSET) / MARS_TO_EARTH_DAYS
      return sols
    end
def sols_from_earth ( earth_date_time ) seconds = earth_date_time . is_a? ( :: Date ) ? earth_date_time . strftime ( "%s" ) . to_f : earth_date_time . to_f days = ( seconds / SECONDS_A_DAY ) + E_DAYS_TIL_UNIX sols = ( days - EPOCH_OFFSET ) / MARS_TO_EARTH_DAYS return sols end
Returns the total number of martian sols for an earth date or time
Returns the total number of martian sols for an earth date or time
number of sols
number of sols
Float
earth_date_time
Earth date or time
Earth date or time