25 #include <boost/algorithm/string/predicate.hpp> 26 #include <boost/date_time/local_time/local_time.hpp> 27 #include <boost/test/unit_test.hpp> 33 boost::local_time::time_zone_ptr tz_ptr(
34 new boost::local_time::posix_time_zone(
"UTC"));
37 boost::gregorian::date(2016, boost::gregorian::Dec, 16),
38 boost::posix_time::hours(0), tz_ptr,
39 boost::local_time::local_date_time::NOT_DATE_TIME_ON_ERROR));
47 boost::gregorian::date(2016, boost::gregorian::Dec, 16),
48 boost::posix_time::hours(0),
nullptr,
49 boost::local_time::local_date_time::NOT_DATE_TIME_ON_ERROR));
51 BOOST_CHECK(!boost::algorithm::ends_with(ti_tz.
toString(),
"UTC+00"));
56 boost::local_time::time_zone_ptr tz_ptr(
57 new boost::local_time::posix_time_zone(
"UTC"));
60 boost::posix_time::not_a_date_time, tz_ptr));
64 BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(test_no_tz)
A class to represent time instant with time zone.
A class to represent time instant with time zone.
std::string toString() const
It returns the time instant with time zone in the ISO textual format (YYYYMMDDThhmmss?hhmm).
An exception class for the DataType module.
BOOST_AUTO_TEST_SUITE(time_instant_tz_test_case) BOOST_AUTO_TEST_CASE(test_ok)