#include
boost::posix_time::ptime now = boost::posix_time::from_time_t(time(NULL));
boost::posix_time::to_simple_string(now); // CCYY-mmm-dd hh:mm:ss.fffffff
boost::posix_time::to_iso_string(now); // YYYYMMDDTHHMMSS
boost::posix_time::to_iso_extended_string(now); // YYYY-MM-DDTHH:MM:SS
#include
void sleep(uint32_t seconds)
{
boost::xtime xt;
boost::xtime_get(&xt, boost::TIME_UTC_);
xt.sec += seconds;
boost::thread::sleep(xt); // Sleep for 1 second
}