亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

時間的API函數

時間的API函數

API
婷婷同學_ 2018-12-04 09:04:32
時間的API函數
查看完整描述

1 回答

?
哈士奇WWW

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(); ///秒



查看完整回答
反對 回復 2018-12-20
  • 1 回答
  • 0 關注
  • 716 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號