Is there some \"standard\" way or the best I can do is to compute it directly by subtracting from gregorian::date(1970,1,1)
?
Here's a variation of @ybungalobill's method that will get you past 2038, just in case. :)
int64_t rax::ToPosix64(const boost::posix_time::ptime& pt)
{
using namespace boost::posix_time;
static ptime epoch(boost::gregorian::date(1970, 1, 1));
time_duration diff(pt - epoch);
return (diff.ticks() / diff.ticks_per_second());
}