如何将自己的编程里的时间设成和电脑时间一致

[复制链接]
查看11 | 回复1 | 2006-3-13 20:39:02 | 显示全部楼层 |阅读模式
楼主是用的是什么工具?如果是C的话 直接调用ctime就OK了函数名: ctime功能: 把日期和时间转换为字符串用法: char *ctime(const time_t *time);程序例:#include #include int main(void){ time_t t; time(&t); printf("Today's date and time: %s\n", ctime(&t)); return 0;}如果是VC的话,也可以使用MFC的。CTime now = CTime::GetCurrentTime();CString s = now.Format("%Y-%m-%d %H:%M:%S");cout << (LPCSTR)s << endl;
回复

使用道具 举报

千问 | 2006-3-13 20:39:02 | 显示全部楼层
timer()msgbox timer()
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行