tm结构类型
2015-10-23 14:58
120 查看
#ifndef _TM_DEFINED
struct tm {
int tm_sec; /* 秒 - 取值区间为[0,59] */
int tm_min; /* 分 - 取值区间为[0,59] */
int tm_hour; /* 时 - 取值区间为[0,23] */
int tm_mday; /* 一个月中的日期 - 取值区间为[1,31] */
int tm_mon; /* 月份(从一月开始,0代表一月)- 取值区间为[0,11] */
int tm_year; /* 年份,其值等于实际年份减去1900 */
int tm_wday; /* 星期–取值区间为[0,6],其中0代表星期天,1代表星期一,以此类推 */
int tm_yday; /* 从每年的1月1日开始的天数 – 取值区间为[0,365],其中0代表1月1日,1代表1月2日,以此类推
*/
int tm_isdst; /*夏令时标识符,实行夏令时的时候,tm_isdst为正。不实行夏令时的进候,tm_isdst为0;不了解情况时,tm_isdst()为负。*/
};
#define _TM_DEFINED /* 避免重复定义 tm */
#endif
ANSI C标准称使用tm结构的这种时间表示为分解时间(broken-down
time)。
包含文件:
把tm指针转换为time_t: time_t
mktime(struct tm *timeptr);
struct tm {
int tm_sec; /* 秒 - 取值区间为[0,59] */
int tm_min; /* 分 - 取值区间为[0,59] */
int tm_hour; /* 时 - 取值区间为[0,23] */
int tm_mday; /* 一个月中的日期 - 取值区间为[1,31] */
int tm_mon; /* 月份(从一月开始,0代表一月)- 取值区间为[0,11] */
int tm_year; /* 年份,其值等于实际年份减去1900 */
int tm_wday; /* 星期–取值区间为[0,6],其中0代表星期天,1代表星期一,以此类推 */
int tm_yday; /* 从每年的1月1日开始的天数 – 取值区间为[0,365],其中0代表1月1日,1代表1月2日,以此类推
*/
int tm_isdst; /*夏令时标识符,实行夏令时的时候,tm_isdst为正。不实行夏令时的进候,tm_isdst为0;不了解情况时,tm_isdst()为负。*/
};
#define _TM_DEFINED /* 避免重复定义 tm */
#endif
ANSI C标准称使用tm结构的这种时间表示为分解时间(broken-down
time)。
包含文件:
把tm指针转换为time_t: time_t
mktime(struct tm *timeptr);
相关文章推荐
- 从0开始学java——Tomcat的安装及其常见错误排查(zz)
- CentOS添加Tomcat自启动
- Java接口使用问题
- 异步JavaScript的进化
- JVM
- CSS实现三角形方法二--border+content
- Maven for Myeclipse的一个常见错误 Project configuration is not up-to-date with pom.xml
- Android 使用 ANT 打包 Android 应用 .
- Java如何处理多线程的数据同步问题
- Flume + Keepalived构建高可用分布式采集系统
- git查看某个文件的修改历史
- git基础
- sap workflow and BPM
- iOS-如何使用symbolicatecrash
- java
- Matlab 如何绘制复杂曲线的包络线
- Android UI设计中一些不错的示例及第三方控件
- mybatisl中#和$区别
- android——Android Studio上传项目到SVN
- js中对函数设置默认参数值的3种方法