unix time 相关
来源:互联网 发布:你见过的神人知乎 编辑:程序博客网 时间:2024/05/19 21:01
struct tm
<ctime>
Time structure
Structure containing a calendar date and time broken down into its components.The structure contains nine members of type int, which are (in any order):
123456789
int tm_sec;int tm_min;int tm_hour;int tm_mday;int tm_mon;int tm_year;int tm_wday;int tm_yday;int tm_isdst;
The meaning of each is:
type
time_t
<ctime>
Time type
Type capable of representing times and support arithmetical operations.This type is returned by the time function and is used as parameter by some other functions of the <ctime> header.
It is almost universally expected to be an integral value representing the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC. This is due to historical reasons, since it corresponds to a unix timestamp, but is widely implemented in C libraries across all platforms.
time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
std::cout<<"today is "<<timeinfo->tm_wday<<std::endl;
timeinfo->tm_year = lexical_cast<int>(ymd[0]) - 1900;
timeinfo->tm_mon = lexical_cast<int>(ymd[1]) - 1;
timeinfo->tm_mday = lexical_cast<int>(ymd[2]);
/* call mktime: timeinfo->tm_wday will be set */
mktime ( timeinfo );
std::cout<<"that day is "<<timeinfo->tm_wday<<std::endl;
- unix time 相关
- java time转为UNIX TIME
- golang time.time相关
- time 相关
- php mysql unix time
- convert long UNIX time
- Difference between Unix Time and UTC time
- Unix epoch time在线转换器
- The UNIX Time-Sharing System
- UNIX环境中Real time, User time and Sys time
- UNIX环境中Real time, User time and Sys time
- UNIX环境中Real time, User time and Sys time
- UNIX环境中Real time, User time and Sys time
- time.c相关
- linux time相关函数
- c#之Time相关
- time函数相关
- ros time相关
- 条款26:限制某个class所能产生的对象数量
- 中美将改头换面融为一体----中美“一体化”
- maven和私服nexus搭建教程
- hadoop rackawareness实现
- HDU 1395 数论小技巧
- unix time 相关
- 文档转换库OutSideIn在64位debian系统下的处理
- hadoop环境配置
- C++中const用法总结
- ios系统自带正则表达式的应用
- weblogic配置 JDBC 多数据源
- Mac下配置Android NDK环境并搭建Cocos2d-x环境并Eclipse正常编译运行
- mfc ribbon中的按钮设置了子项后需添加一个空的响应函数才能使之able
- c语言面试题(3)