Boost logo

Boost Users :

Subject: [Boost-users] [datetime] little problem with periods
From: Georg.Kellerer_at_[hidden]
Date: 2015-06-23 07:42:03


Hello,

i am using Boost V1.5.8 under vs 2010 with a german windows 7 64 bit. When I tried to calculate a time period I always ran into the same problem. The period is calculated one day too short. I wrote a little program to illustrate my problem. It's important that you change the value of the variable test to the current date. Is this a bug or do I use the library in an incorrect way?

Thanks a lot,
Georg

#include "boost/date_time.hpp"
#include <iostream>
using namespace std;
using namespace boost::gregorian;

int main()
{
       date today = day_clock::local_day();
       date test(2015,6,23); // Change value to current date
       date first(1965,10,26);
       date_period period(first, today);
       if (!period.contains(test))
   cout << "shouldn't be our testdate in the period? " << endl;
}



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net