mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
74e4288549
allows working around clock skew issues
21 lines
No EOL
288 B
Ruby
21 lines
No EOL
288 B
Ruby
module Fog
|
|
class Time < ::Time
|
|
class << self
|
|
|
|
def now
|
|
::Time.now - offset
|
|
end
|
|
|
|
def now=(new_now)
|
|
old_now = ::Time.now
|
|
@offset = old_now - new_now
|
|
new_now
|
|
end
|
|
|
|
def offset
|
|
@offset ||= 0
|
|
end
|
|
|
|
end
|
|
end
|
|
end |