在线文档教程
C++
应用 | Utilities

std::tm

性病::TM

Defined in header
struct tm;

结构,该结构保存日历日期和时间,并将其分解为其组件。

成员对象

int tm_secseconds after the minute – 0, 61 / 0, 60note 1
int tm_minminutes after the hour – 0, 59
int tm_hourhours since midnight – 0, 23
int tm_mdayday of the month – 1, 31
int tm_monmonths since January – 0, 11
int tm_yearyears since 1900 (public member object)
int tm_wdaydays since Sunday – 0, 6
int tm_ydaydays since January 1 – 0, 365
int tm_isdstDaylight Saving Time flag. The value is positive if DST is in effect, zero if not and negative if no information is available (public member object)

{"blocks":[{"type":"header-six","text":"\u6ce8\u8bb0","depth":0,"inlineStyleRanges":[],"entityRanges":[],"key":"99315"}],"entityMap":[]}

  • 距离允许一个积极的闰秒。同一分钟内的两个闰秒是不允许的,范围为0.61是C89引入的缺陷,C99%29修正了

另见

localtimeconverts time since epoch to calendar time expressed as local time (function)
gmtimeconverts time since epoch to calendar time expressed as Universal Coordinated Time (function)

c tm文件

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/crono/c/tm