Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/rbvmomi/vim/PerformanceManager.rb

Instance Method Summary collapse

Instance Method Details

#to_datetimeObject



7
8
9
10
11
12
13
14
15
# File 'lib/rbvmomi/vim/PerformanceManager.rb', line 7

def to_datetime
  # Convert seconds + microseconds into a fractional number of seconds
  seconds = sec + Rational(usec, 10**6)

  # Convert a UTC offset measured in minutes to one measured in a
  # fraction of a day.
  offset = Rational(utc_offset, 60 * 60 * 24)
  DateTime.new(year, month, day, hour, min, seconds, offset)
end