Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/certificate-transparency/extensions/time.rb

Overview

Extensions to the Time class.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.ms(i) ⇒ Object

Create a new instance of Time, set to the given number of milliseconds since the epoch.



14
15
16
# File 'lib/certificate-transparency/extensions/time.rb', line 14

def self.ms(i)
	Time.at(i.to_f / 1000)
end

Instance Method Details

#msObject

Return the time represented by this object, in milliseconds since the epoch.



7
8
9
# File 'lib/certificate-transparency/extensions/time.rb', line 7

def ms
	(self.to_f * 1000).round
end