Class: Time
- Inherits:
-
Object
- Object
- Time
- Defined in:
- lib/certificate-transparency/extensions/time.rb
Overview
Extensions to the Time class.
Class Method Summary collapse
-
.ms(i) ⇒ Object
Create a new instance of Time, set to the given number of milliseconds since the epoch.
Instance Method Summary collapse
-
#ms ⇒ Object
Return the time represented by this object, in milliseconds since the epoch.
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
#ms ⇒ Object
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 |