Tag: 独立平台

C ++将时间字符串转换为纪元的秒数

我有一个格式如下的字符串: 2010-11-04T23:23:01Z Z表示时间是UTC。 我宁愿把它存储为一个时间点,以便比较容易。 这样做的推荐方法是什么? 目前(在quck搜索之后),简化算法是: 1: 2: Use mktime() to convert struct_tm to epoch time. // Problem here is that mktime uses local time not UTC time.