class Windows::File::Structs::SYSTEMTIME

Public Class Methods

new(time = nil) click to toggle source

Allow a time object or raw numeric in constructor

Calls superclass method
# File lib/win32/file/structs.rb, line 21
def initialize(time = nil)
  super()

  time = Time.at(time) if time.is_a?(Numeric)
  time = time.utc unless time.utc?

  self[:wYear] = time.year
  self[:wMonth] = time.month
  self[:wDayOfWeek] = time.wday
  self[:wDay] = time.day
  self[:wHour] = time.hour
  self[:wMinute] = time.min
  self[:wSecond] = time.sec
  self[:wMilliseconds] = time.nsec / 1000000
end