4 #include <boost/date_time/gregorian/gregorian.hpp> 5 #include <boost/date_time/posix_time/posix_time.hpp> 15 static boost::gregorian::date
epoch;
20 boost::posix_time::ptime t =
21 boost::posix_time::microsec_clock::local_time();
22 long days = (t.date() -
epoch).days();
23 long msec = t.time_of_day().total_milliseconds();
25 return (
unsigned long)days * MSEC_IN_DAY + msec;
34 #endif // __EVENTLOG_H
static unsigned long timestamp()
Definition: eventlog.h:19
static std::string timestamp_to_str()
Definition: eventlog.h:28
static boost::gregorian::date epoch
Definition: eventlog.h:15
static const unsigned long MSEC_IN_DAY
Definition: eventlog.h:17