大师的学徒

关注

c/c++ utc时间转unix时间戳

大师的学徒

关注

阅读 61

2022-01-26

time.h是c/c++标准头文件
time_t类型其实就是整型,视平台不同,有32位、64位。

    struct tm t;
    t.tm_sec = i_sec;
    t.tm_hour = i_hour;
    t.tm_min = i_minute;
    t.tm_mday = i_day;
    t.tm_mon = i_month-1;
    t.tm_year = i_year-1900;
    t.tm_isdst = 0;
    time_t _t = mktime(&t);
    if(-1 == _t ){
        perror("parse error");
    }

相关推荐

Python芸芸

java当前时间转UTC时间戳

Python芸芸 101 0 0

王传学

python unix 时间戳转时间

王传学 46 0 0

书呆鱼

UTC时间、GMT时间、本地时间、Unix时间戳的具体使用

书呆鱼 88 0 0

q松_松q

时间转时间戳 时间戳转时间

q松_松q 161 0 0

Yaphets_巍

【unix时间戳小示例】linux/unix系统获取unix时间戳

Yaphets_巍 84 0 0

Ichjns

python 获取 utc 时间戳

Ichjns 48 0 0

梦幻之云

Java unix时间戳

梦幻之云 79 0 0

是波波呀

Unix时间戳1970Java与Unix时间戳互转

是波波呀 57 0 0

guanguans

【C/C++时间系列】通过time()函数获取时间戳

guanguans 78 0 0

爱奔跑的读书者

Java获取unix时间戳

爱奔跑的读书者 83 0 0

精彩评论(0)

0 0 举报