现在的位置: 首页 > 综合 > 正文

获取系统时间

2013年10月01日 ⁄ 综合 ⁄ 共 438字 ⁄ 字号 评论关闭

Windows API:
void GetSystemTime(LPSYSTEMTIME lpSystemTime);

CB:
Now();
DateTimeToStr(Now());
Now()=Date()+Time();

TDateTime   myDataTime;  
myDataTime.CurrentDate();//返回当前日期  
myDateTime.CurrentTime();//返回当前时间

void gettime(struct time *timep);
void settime(struct time *timep);
struct time {
   unsigned char ti_min;      /* minutes */
   unsigned char ti_hour;     /* hours */
   unsigned char ti_hund;     /* hundredths of seconds */
   unsigned char ti_sec;      /* seconds */
};

VC:
CTime类

 

抱歉!评论已关闭.