学习分析TZFILE

学习分析tzfile

文件结构

Head:

tzh_ttisgmtcnt
The number of UTC/local indicators stored in the file.
tzh_ttisstdcnt
The number of standard/wall indicators stored in the file.
tzh_leapcnt
The number of leap seconds for which data is stored in the file.
tzh_timecnt
The number of "transition times" for which data is stored in the file.
tzh_typecnt
The number of "local time types" for which data is stored in the file (must not be zero).
tzh_charcnt
The number of characters of "timezone abbreviation strings" stored in the file.


transition times: long * tzh_timecnt 按时间升序排列

local time type: unsigned char * tzh_timecnt  这里的数据是ttinfo数组的指数,指明用哪个ttinfo结构的数据

ttinfo:

struct ttinfo {
    long         tt_gmtoff;
    int          tt_isdst;
    unsigned int tt_abbrind;
};
leap second(闰秒): four-byte * tzh_leapcnt * 2

第一个是闰秒发生时间 ,第二个是应用的时间上的闰秒总数。这对闰秒数据是按时间升序排列。

standard/wall indicators: one-byte * tzh_ttisstdcnt  指明transition time是否作为标准或者挂钟时间

UTC/local indicators one-byte * tzh_ttisgmtcnt 指明transition time是否作为UTC或者本地时间


tzif2:最后会有个POSIX时区字符串


日期开始从周一开始,周日结束

Transition time 的DST开始时间需要减去1小时,在结束时间加上1小时





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值