C++取系统当前时间/时间戳
版权声明:
本文为博主原创文章,转载请声明原文链接...谢谢。o_0。
更新时间:
2014-09-16 13:55:45
温馨提示:
学无止境,技术类文章有它的时效性,请留意文章更新时间,如发现内容有误请留言指出,防止别人"踩坑",我会及时更新文章
//首先引入头文件#include "afx.h" CTime t = CTime::GetCurrentTime(); string t_str=t.Format("%Y-%m-%d %H:%M:%S"); string str="当前时间"+t_str;取秒级时间戳
time_t timestamp; time(×tamp);取毫秒级时间戳
clock_t timestamp=clock()*1000/CLOCKS_PER_SEC;