打印当前日期和时间
C程序:
#include <time.h>
#include <stdio.h>
int main(void)
{
time_t t;
time(&t);
printf("The Calendar Time now is %s\n",ctime(&t));
return 0;
}
编译后运行程序,输出结果:
The Calendar Time now is Fri Jun 28 10:06:18 2013
Press any key to continue
附加对应的python程序:
import time
print time.ctime()
执行,输出结果:
'Fri Jun 28 10:10:31 2013'
参考资料:
python time模块详解
http://blog.csdn.net/kiki113/article/details/4033017
记录微秒级时间日志
logtest.h