c语言中的time(time_t* time)返回的是毫秒单位还是秒单位?

xychzh 2011-03-01 07:59:30
如题。。
百度找了半天没找到.
...全文
3621 17 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
中才德创 2011-03-02
  • 打赏
  • 举报
回复
second
pathuang68 2011-03-02
  • 打赏
  • 举报
回复
秒。for sure
赵4老师 2011-03-02
  • 打赏
  • 举报
回复
second 秒
millisecond 毫秒=1/1000秒
microsecond 微秒=1/1000000秒
nanosecond 纳秒=1/1000000000秒
喜欢简单 2011-03-02
  • 打赏
  • 举报
回复
[Quote=引用 15 楼 anyidan 的回复:]
struct tm {
int tm_sec; /* seconds after the minute - [0,59] */
int tm_min; /* minutes after the hour - [0,59] */
int tm_hour; /* hours since midnight - [0,23] */
int tm_mday; /* day of th……
[/Quote]

看看结构体的定义,一目了然
AnYidan 2011-03-02
  • 打赏
  • 举报
回复

struct tm {
int tm_sec; /* seconds after the minute - [0,59] */
int tm_min; /* minutes after the hour - [0,59] */
int tm_hour; /* hours since midnight - [0,23] */
int tm_mday; /* day of the month - [1,31] */
int tm_mon; /* months since January - [0,11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday - [0,6] */
int tm_yday; /* days since January 1 - [0,365] */
int tm_isdst; /* daylight savings time flag */
};
#define _TM_DEFINED


只到 秒
julysee 2011-03-02
  • 打赏
  • 举报
回复
秒....
碎碎念 2011-03-02
  • 打赏
  • 举报
回复
一般都是毫秒。。。
wizard_tiger 2011-03-02
  • 打赏
  • 举报
回复
应该表示到秒吧,到毫秒不够。
返回的是long int型。
hawk198 2011-03-02
  • 打赏
  • 举报
回复
time_t是int,在32位系统下就4字节,只能表示到秒
「已注销」 2011-03-01
  • 打赏
  • 举报
回复
秒秒秒秒
yuppy 2011-03-01
  • 打赏
  • 举报
回复
1970年1月1日0时0分0秒开始计算到现在的秒数

2038年就过期~
「已注销」 2011-03-01
  • 打赏
  • 举报
回复
Seconds
Windows:msdn time
Linux :man 2 time
emoshusheng 2011-03-01
  • 打赏
  • 举报
回复
就是秒
yiyefangzhou24 2011-03-01
  • 打赏
  • 举报
回复
毫秒吧
jinzhou520 2011-03-01
  • 打赏
  • 举报
回复
从1970年1月1日0时0分0秒开始计算到现在的秒数,
参考于:http://www.sudu.cn/info/html/edu/20070101/287426.html

过查阅MSDN,我们能知道Microsoft C/C++
7.0中时间点的值(time_t对象的值)是从1899年12月31日0时0分0秒到该时间点所经过的秒数,而其他各种版本的Microsoft C/C++和所有不同版本的Visual C++都是计算的从1970年1月1日0时0分0秒到该时间点所经过的秒数。
  • 打赏
  • 举报
回复
秒,就4个字节,毫秒不够表示的
昵称很不好取 2011-03-01
  • 打赏
  • 举报
回复
没有MSDN?
Return Value

time returns the time in elapsed seconds. There is no error return.

Parameter

timer

Storage location for time

Remarks

The time function returns the number of seconds elapsed since midnight (00:00:00), January 1, 1970, coordinated universal time, according to the system clock. The return value is stored in the location given by timer. This parameter may be NULL, in which case the return value is not stored.


70,022

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧