How do I convert boost::posix_time::ptime to time_t?

后端 未结 5 1987
孤独总比滥情好
孤独总比滥情好 2020-12-05 06:49

Is there some \"standard\" way or the best I can do is to compute it directly by subtracting from gregorian::date(1970,1,1)?

5条回答
  •  天涯浪人
    2020-12-05 07:02

    I believe the best you can do is using to_tm to get a tm and mktime to convert the tm to a time_t.

提交回复
热议问题