SYSTEMTIME

Far Manager

SYSTEMTIME

The SYSTEMTIME structure represents a date and time using individual members for the month, day, year, weekday, hour, minute, second, and millisecond.
typedef struct _SYSTEMTIME {
  WORD wYear;
  WORD wMonth;
  WORD wDayOfWeek;
  WORD wDay;
  WORD wHour;
  WORD wMinute;
  WORD wSecond;
  WORD wMilliseconds;
} SYSTEMTIME;

Members

wYear
Specifies the current year. The year must be greater than 1601.

Windows XP, Windows Server Windows XP, Windows Server

  • The year cannot be greater than 30827.
wMonth
Specifies the current month; January = 1, February = 2, and so on.
wDayOfWeek
Specifies the current day of the week; Sunday = 0, Monday = 1, and so on.
wDay
Specifies the current day of the month.
wHour
Specifies the current hour (0-23).
wMinute
Specifies the current minute (0-59).
wSecond
Specifies the current second (0-59).
wMilliseconds
Specifies the current millisecond (0-999).

Remarks

It is not recommended that you add or substract values from this structure to obtain relative times. Instead, you should do the following:

  • Convert the SYSTEMTIME structure to a FILETIME structure using the SystemTimeToFileTime function.
  • Copy the resulting FILETIME structure to a ULARGE_INTEGER structure.
  • Use standard 64-bit arithmetic on the ULARGE_INTEGER value or cast a variable of FILETIME type to the __int64 type:
    FILETIME WriteTime1, WriteTime2;
    
    if(*(__int64*) & WriteTime1 == *(__int64*) & WriteTime2)
     ...
    

See also: