org.at4j.support.util
Class MsDosDate

java.lang.Object
  extended by org.at4j.support.util.MsDosDate

public final class MsDosDate
extends Object

This class contains static utility methods for working with MS DOS dates. An MS DOS date is a year, a month and a day of month and it can be encoded in two bytes.

See the Microsoft documentation.

Since:
1.0
Author:
Karl Gustafsson
See Also:
MsDosTime

Method Summary
static UnsignedShort encodeMsDosDate(Calendar cal)
          Encode the MS DOS date (year, month and day of month) stored in the Calendar object to an unsigned short value.
static void parseMsDosDate(UnsignedShort s, Calendar cal)
          Parse the MS DOS date (year, month and day of month) encoded in the supplied unsigned short value and update the calendar object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseMsDosDate

public static void parseMsDosDate(UnsignedShort s,
                                  Calendar cal)
                           throws IllegalArgumentException
Parse the MS DOS date (year, month and day of month) encoded in the supplied unsigned short value and update the calendar object.

The date should be encoded as described here.

Parameters:
s - The encoded date.
cal - The calendar to update with the date.
Throws:
IllegalArgumentException - If the encoded date is invalid.

encodeMsDosDate

public static UnsignedShort encodeMsDosDate(Calendar cal)
Encode the MS DOS date (year, month and day of month) stored in the Calendar object to an unsigned short value.

The date is encoded as described here.

Parameters:
cal - The calendar object containing the date to encode.
Returns:
The encoded date.