#include #include #include using namespace std; int main(int argc_, char *argv_[]) { using namespace boost::gregorian; using namespace boost::posix_time; typedef boost::date_time::us_dst_rules us_dst; assert(us_dst::local_dst_start_day(2006) == date(2006, Apr, 2)); assert(us_dst::local_dst_end_day(2006) == date(2006, Oct, 29)); date start2007(2007, Mar, 11); date end2007(2007, Nov, 4); if (us_dst::local_dst_start_day(2007) != start2007) { cerr << "Start for 2007 is " << us_dst::local_dst_start_day(2007) << " but should be " << start2007 << endl; } if (us_dst::local_dst_end_day(2007) != end2007) { cerr << "End for 2007 is " << us_dst::local_dst_end_day(2007) << " but should be " << end2007 << endl; } }