Class: DateTime

Inherits:
Object
  • Object
show all
Defined in:
lib/fjords/cli/core.rb,
lib/fjords/cli/core.rb

Instance Method Summary collapse

Instance Method Details

#to_iObject



18
19
20
# File 'lib/fjords/cli/core.rb', line 18

def to_i
  seconds_since_unix_epoch.to_i
end

#to_timeObject



9
10
11
12
# File 'lib/fjords/cli/core.rb', line 9

def to_time
  usec = (new_offset.sec_fraction * 60 * 60 * 24 * (10**6)).to_i
  Time.gm(new_offset.year, new_offset.month, new_offset.day, new_offset.hour, new_offset.min, new_offset.sec, usec)
end