class Time
Public Instance Methods
say_hi()
click to toggle source
# File lib/to_xl.rb, line 17 def say_hi puts "Hello there" end
to_excel()
click to toggle source
# File lib/to_xl.rb, line 7 def to_excel @seconds_in_day ||= 24 * 60 * 60 @excel_days_offset ||= 25569 @offset_gmt = (self.hour > self.gmtime.hour) ? true : false # Excel dates are on GMT time, so we have to go back a day if this is calculated on one day in our time zone and another on GMT. excel_date = (self.to_i/@seconds_in_day) + @excel_days_offset excel_date -= 1 if @offset_gmt # Excel dates are on GMT time, so we have to go back a day if this is calculated on one day in our time zone and another on GMT. excel_date end
Also aliased as: to_xl