Class: RAPI::Native::FILETIME

Inherits:
Object
  • Object
show all
Extended by:
FFI::DataConverter
Defined in:
lib/rapi.rb

Class Method Summary collapse

Class Method Details

.from_native(val, ctx) ⇒ Object



391
392
393
# File 'lib/rapi.rb', line 391

def self.from_native(val, ctx)
  Time.at((val * 1.0e-07) + Time.new(1601).to_f)
end

.to_native(val, ctx) ⇒ Object



395
396
397
# File 'lib/rapi.rb', line 395

def self.to_native(val, ctx)
  ((val.to_f - Time.new(1601).to_f) / 1.0e-07).to_i 
end