1 回答

TA貢獻1799條經驗 獲得超6個贊
GetSystemTime
1、GetSystemTime -
VB聲明
Declare Sub GetSYSTEMTIME Lib "kernel32" Alias "GetSystemTime" (lpSystemTime As SYSTEMTIME)
說明:在一個SYSTEMTIME中載入當前系統時間,這個時間采用的是“協同世界時間”(即UTC,也叫做GMT)格式
參數 類型及說明:lpSystemTime SYSTEMTIME,隨同當前時間載入的結構
2、Ada聲明
type WORD is mod 2**16;
-- SYSTEMTIME 結構
type SYSTEMTIME is record
year : word; -- 年
month : word; -- 月
dayofweek : word; -- 星期,0=星期日,1=星期一
day : word; -- 天
hour : word; -- 時
minute : word; -- 分
second : word; -- 秒
Milliseconds : word; -- 毫秒
end record;
type LPSYSTEMTIME is access SYSTEMTIME;
procedure GetSystemTime(SYSTIME:LPSYSTEMTIME);
function GetSystemTime(SYSTIME:LPSYSTEMTIME) return integer;
pragma import(stdcall,GetSystemTime,"GetSystemTime");
3、注意:
(1)參數SYSTIME必須首先分配內存空間,否則引起PROGRAM_ERROR 。
(2)該函數獲取格林威治標準時間。
4、范例:
CTime time = CTime::GetCurrentTime(); ///構造CTime對象
int m_nYear = time.GetYear(); ///年
int m_nMonth = time.GetMonth(); ///月
int m_nDay = time.GetDay(); ///日
int m_nHour = time.GetHour(); ///小時
int m_nMinute = time.GetMinute(); ///分鐘
int m_nSecond = time.GetSecond(); ///秒
- 1 回答
- 0 關注
- 716 瀏覽
添加回答
舉報