#include "exceptions.h"
#include "dcp_assert.h"
#include <boost/lexical_cast.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/c_local_time_adjustor.hpp>
+#include <boost/date_time/gregorian/gregorian.hpp>
#include <cstdio>
using std::string;
* time zone.
*/
LocalTime::LocalTime (boost::posix_time::ptime t)
+{
+ set (t);
+}
+
+void
+LocalTime::set (boost::posix_time::ptime t)
{
_year = t.date().year ();
_month = t.date().month ();
}
}
+void
+LocalTime::add_minutes (int m)
+{
+ using namespace boost;
+
+ posix_time::ptime t(gregorian::date(_year, _month, _day), posix_time::time_duration(_hour, _minute, _second));
+ t += posix_time::time_duration(0, m, 0);
+ set (t);
+}
+
bool
LocalTime::operator== (LocalTime const & other) const
{