C++ Converting a time string to seconds from the epoch

前端 未结 10 592
無奈伤痛
無奈伤痛 2020-12-01 14:53

I have a string with the following format:

2010-11-04T23:23:01Z

The Z indicates that the time is UTC.
I would rather store t

10条回答
  •  一向
    一向 (楼主)
    2020-12-01 15:20

    You can use a function such as strptime to convert a string to a struct tm, instead of parsing it manually.

提交回复
热议问题