- 论坛徽章:
- 3
|
原帖由 郝国辉 于 2008-12-10 17:24 发表 ![]()
ctime函数不也返回时间字符串吗??我屏幕上看到的输出时间是ctime返回的.它和time函数有关系吗?就打印输出的字符串和time有关系???
time取得时间但是返回的是time_t类型,ctime把这个时间(time取得的)转换成像00:00:00 UTC, January 1, 1970这种格式,比较方便人看。
time_t time(time_t *t);
time() returns the time since the Epoch (00:00:00 UTC, January 1, 1970), measured in seconds.
The ctime(), gmtime() and localtime() functions all take an argument of data type time_t which represents calendar time. When interpreted as an absolute time value, it represents the number of seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC). |
|