Parent

Methods

Time

Public Instance Methods

to_dos_time() click to toggle source

Returns a DOSTime representing this time object as a DOS date-time structure. Times are bracketed by the limits of the ability of the DOS date-time structure to represent them. Accuracy is 2 seconds and years range from 1980 to 2099. The returned structure represents as closely as possible the time of this object.

See DOSTime#new for a description of this structure.

# File lib/archive/support/time.rb, line 10
def to_dos_time
  dos_sec  = sec/2
  dos_year = year - 1980
  dos_year = 0   if dos_year < 0
  dos_year = 119 if dos_year > 119

  Archive::DOSTime.new(
    (dos_sec       ) |
    (min      <<  5) |
    (hour     << 11) |
    (day      << 16) |
    (month    << 21) |
    (dos_year << 25)
  )
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.