unix timestamp to boost::posix_time::ptime

前端 未结 3 1002
Happy的楠姐
Happy的楠姐 2021-01-17 13:42

I need to convert double with number of seconds since the epoch to ptime. I\'m prety sure there must be an easy way to do this, but I couldn\'t find anything. T

3条回答
  •  遇见更好的自我
    2021-01-17 14:15

    Use the from_time_t() conversion function. A time_t is a UNIX timestamp, i.e. the number of seconds since the epoch.

提交回复
热议问题