Convert timestamp (in milliseconds) to boost ptime

boost, c++, datetime

Solution

from_time_t(millis / 1000) + millisec(millis % 1000)

Problem

I need to convert the a time measured in milliseconds since the epoch to a `boost::posix_time::ptime`. The only function I see is to convert is `from_time_t` but that is only in seconds and would lose the milliseconds. How can I convert from milliseconds since epoch to a ptime type?

Original source