C++时间戳 字符串 时间格式
来源:互联网 发布:电子标书的软件 编辑:程序博客网 时间:2024/06/10 21:41
time_t rawtime;
time(&rawtime);
rawtime就是时间戳
CCLOG(“%s”,ctime (&rawtime));
CCLOG(“%ld”,rawtime);
struct tm * ptm;
ptm = localtime(&rawtime);
ptm就是时间格式
CCLOG(“%d”,ptm->tm_hour);
mktime可以把时间格式转换成时间戳
time_t ft=mktime(ptm);
CCLOG(“%d”,ft);
struct tm
{
int tm_sec; /秒,正常范围0-59, 但允许至61/
int tm_min; /分钟,0-59/
int tm_hour; /小时, 0-23/
int tm_mday; /日,即一个月中的第几天,1-31/
int tm_mon; /月, 从一月算起,0-11/ 1+p->tm_mon;
int tm_year; /年, 从1900至今已经多少年/ 1900+ p->tm_year;
int tm_wday; /星期,一周中的第几天, 从星期日算起,0-6/
int tm_yday; /从今年1月1日到目前的天数,范围0-365/
int tm_isdst; /日光节约时间的旗标/
};
0 0
- 时间戳转换成时间格式字符串
- C++时间戳 字符串 时间格式
- C获取系统时间(字符串格式)
- perl 字符串格式转化为时间格式,时间戳,epchotime
- 字符串转时间格式
- 字符串转时间格式
- 时间格式字符串转化为date和时间戳
- 把字符串转成NSDate时间格式 并显示时间戳
- Python的时间字符串,不同格式,时间戳之间转换
- c++ 时间戳、日期格式、字符串
- 时间戳转日期格式字符串
- 时间戳字符串转化为date格式
- 时间获取,以及时间格式字符串转化
- c#时间字符串转换位时间格式
- c#时间字符串转换位时间格式 .
- oracle时间格式字符串转化为时间
- objective-c获得字符串格式的当前时间
- C语言 将时间转换成指定格式的字符串
- UILabel 设置不同颜色,不同字体
- makefile规则
- Download From FTP
- jquery中复选框checked属性
- 《Java课程实习》日志(周三)
- C++时间戳 字符串 时间格式
- 黑马程序员——Java基础--多线程(一)
- 4.MySQL程序概述
- 用Spring MVC和Freemarker实现导出PDF
- Solution to the problem of machine name becomes "bogon" in Mac
- iOStableviewcell系统自带删除注意事项
- Java导出数据到txt文件
- C# 正则表达式抓取网页上某个标签的内容,并替换链接地址和图片地址
- ScriptController 创建时机堆栈 和销毁时机堆栈