CIFS Date and Time Encoding

Dates are encoded as follows:

struct {
        USHORT Day : 5;
        USHORT Month : 4;
        USHORT Year : 7;
} SMB_DATE;

The Year member has a range of 0-119, which represents the years 1980 - 2099; Month ranges from 1-12; and Day ranges from 1-31.

Time is encoded as follows:

struct {
        USHORT TwoSeconds : 5;
        USHORT Minutes : 6;
        USHORT Hours : 5;
} SMB_TIME;

The Hours member ranges from 0-23, Minutes ranges from 0-59, and TwoSeconds ranges from 0-29, representing two-second increments within the minute.

64-bit Absolute and Relative Time Encoding

The TIME data type indicates a signed 64-bit integer representing either an absolute time or a time interval. Times are specified in units of 100ns. A positive value expresses an absolute time, where the base time (the 64-bit integer with value 0) is the beginning of the year 1601 AD in the Gregorian calendar. A negative value expresses a time interval relative to some base time, usually the current time.

typedef unsigned long UTIME;

where UTIME is the number of seconds since Jan 1, 1970, 00:00:00.0.

See Also

Royalty-Free CIFS Technical Reference License Agreement