Class Archive::DOSTime
In: lib/archive/support/time.rb
Parent: Object

Methods

<=>   cmp   new   pack   to_i   to_time  

Included Modules

Comparable

Public Class methods

Creates a new instance of DOSTime. dos_time is a 4 byte String or unsigned number (Integer) representing an MS-DOS time structure where:

Bits 0-4:2 second increments (0-29)
Bits 5-10:minutes (0-59)
Bits 11-15:hours (0-24)
Bits 16-20:day (1-31)
Bits 21-24:month (1-12)
Bits 25-31:four digit year minus 1980 (0-119)

If dos_time is ommitted or nil, a new instance is created based on the current time.

Public Instance methods

<=>(other)

Alias for cmp

Returns -1 if other is a time earlier than this one, 0 if other is the same time, and 1 if other is a later time.

Returns the 32 bit integer that backs this object packed into a String in little endian format. This is suitable for use with new.

Returns the time value of this object as an integer representing the DOS time structure.

Returns a Time instance which is equivalent to the time represented by this object.

[Validate]