Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-wmi/core_ext/time_ext.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse_swbem_date_time(string) ⇒ Object



3
4
5
6
# File 'lib/ruby-wmi/core_ext/time_ext.rb', line 3

def parse_swbem_date_time(string)
  dt = /(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)\.(\d+)([+-]\d\d\d)/.match(string)
  local($1,$2,$3,$4,$5,$6)
end

Instance Method Details

#to_swbem_date_timeObject



9
10
11
12
13
# File 'lib/ruby-wmi/core_ext/time_ext.rb', line 9

def to_swbem_date_time
  t = strftime("%Y%m%d%H%M%S")
  o = gmt_offset/60
  "#{t}.000000#{o}" 
end