SYSTEMTIME

SYSTEMTIME

在Win32程式彙編中有SYSTEMTIME類數據結構。

基本介紹

  • 外文名:SYSTEMTIME
  • 含義:SYSTEMTIME類數據結構
  • 平台:Win32
  • 類型:軟體開發
win32的API函式,MSDN中的解釋,Syntax,Parameters,Return Value,Requirements,

win32的API函式

SYSTEMTIME結構定義如下:
SYSTEMTIME STRUCT
{
WORD wYear ; 年
WORD wMonth ;月
WORD wDayOfWeek ;星期,0=星期日,1=星期一...
WORD wDay ;日
WORD wHour ;時
WORD wMinute ;分
WORD wSecond ;秒
WORD wMilliseconds ;毫秒
}SYSTEMTIME ENDS
結構中的欄位全為word類型,而Win32程式中用的往往是dword型變數,所以在使用這些數據之前往往要先把它們轉換為dword類型,用movzx指令就可以實現。
在SYSTEMTIME數據結構里,日期和時間都被編碼了.月份是從1月開始的(一月份就是1月)。周日是從0開始的(星期天是0).wDay是在當前月份下的日期,也是從1開始的。
與獲取系統時間的函式相對應,可以用下面的兩個函式設定系統時間:
invoke SetLocalTime,lpSystemTime,GetLocalTime獲取本地時間
invoke SetSystemTime,lpSystemTime;獲取格林威治標準時間
參考資料:《Windows環境下32位彙編語言程式設計》

MSDN中的解釋

Converts a file time to system time format. System time is based on Coordinated Universal Time (UTC).

Syntax

BOOL WINAPI FileTimeToSystemTime( __in const FILETIME *lpFileTime, __out LPSYSTEMTIME lpSystemTime);

Parameters

lpFileTime [in]A pointer to a FILETIME structure containing the file time to be converted to system (UTC) date and time format. This value must be less than 0. Otherwise, the function fails. lpSystemTime [out]A pointer to a SYSTEMTIME structure to receive the converted file time.

Return Value

If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.

Requirements


Windows 2000 Professional

Windows 2000 Server

Winbase.h (include Windows.h)

Kernel32.lib

Kernel32.dll

相關詞條

熱門詞條

聯絡我們