std::tm

定义于头文件 <ctime>
struct tm;

保有拆分到组分的日历日期和时间的结构体。

成员对象

int tm_sec
分后之秒 – [0, 61](C++11 前) / [0, 60] (C++11 起)[注 1]
(公开成员对象)
int tm_min
时后之分 – [0, 59]
(公开成员对象)
int tm_hour
自午夜起之时 – [0, 23]
(公开成员对象)
int tm_mday
月之日 – [1, 31]
(公开成员对象)
int tm_mon
自一月起之月 – [0, 11]
(公开成员对象)
int tm_year
自 1900 起之年
(公开成员对象)
int tm_wday
自星期日起之日 – [0, 6]
(公开成员对象)
int tm_yday
自一月 1 日起之日 – [0, 365]
(公开成员对象)
int tm_isdst
夏令时标志。值若夏令时有效则为正,若无效则为零,若无可用信息则为负
(公开成员对象)
注意
  1. 范围允许正闰秒。不允许同一分钟内的二个闰秒( C89 中错误地引入范围 0..61 ,而在 C99 中更正)

参阅

转换纪元起时间到表示为本地时间的日历时间
(函数)
转换纪元起时间为表示为协调世界时的日历时间
(函数)
tmC 文档

版本历史

  • (当前 | 先前 2017年10月8日 (日) 05:35Fruderica讨论 | 贡献 . . (1,521字节) (-2). . (撤销)
  • 当前 | 先前 2017年10月8日 (日) 05:34Fruderica讨论 | 贡献. . (1,523字节) (-576). . (撤销)
  • 当前 | 先前 2013年7月2日 (二) 07:20P12bot讨论 | 贡献 . . (2,099字节) (-100). . (Use {{lc}}. Update links. Various fixes.) (撤销)
  • 当前 | 先前 2012年11月2日 (五) 15:42P12bot讨论 | 贡献 . . (2,199字节) (+185). . (r2.7.3) (机器人添加:de, en, es, fr, it, ja, pt, ru) (撤销)
  • 当前 | 先前 2012年10月26日 (五) 09:50P12讨论 | 贡献 . . (2,014字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前 2012年10月26日 (五) 06:00TranslationBot讨论 | 贡献. . (2,014字节) (-76). . (Translated from the English version using Google Translate) (撤销)
  • 当前 | 先前 2012年10月25日 (四) 13:14P12讨论 | 贡献 . . (2,090字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前) 2012年10月25日 (四) 12:00TranslationBot讨论 | 贡献. . (2,090字节) (+2,090). . (Translated from the English version using Google Translate)