c语言获取系统当前时间的函数,求讲解?

c语言获取系统当前时间的函数,求讲解


慕桂英3389331
浏览 663回答 2
2回答

慕田峪7331174

time_t是个重定义的长整型结构。调用time函数获取时间,返回的是一个秒数。当前时间需要调用localtime进行转换一下。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 */};
打开App,查看更多内容
随时随地看视频慕课网APP