replace timeval and time_t with boost::posix_time::ptime