Class: DateTime

Inherits:
Object show all
Defined in:
lib/time_crisis/conversions.rb

Instance Method Summary collapse

Instance Method Details

#to_tc_dateObject



30
31
32
# File 'lib/time_crisis/conversions.rb', line 30

def to_tc_date
  TimeCrisis::Date.civil(year, month, day)
end

#to_tc_datetimeObject



34
35
36
# File 'lib/time_crisis/conversions.rb', line 34

def to_tc_datetime
  TimeCrisis::DateTime.civil(year, month, day, hour, min, sec, 0, (offset * 86400).to_i)
end

#to_tc_timeObject



38
39
40
# File 'lib/time_crisis/conversions.rb', line 38

def to_tc_time
  TimeCrisis::Time.at(self.to_f)
end