Boost logo

Boost Users :

From: Jeff Garland (jeff_at_[hidden])
Date: 2003-02-27 09:06:58


Alex wrote:
>... start omitted ...
>time_period p(ptime(date(2003, 03, 25)), ptime(date(2003, 04,
>25)));
>date_duration duration(days(1));
>p.shift(duration);
>----------------------------------------------------

I'm not sure where 'days' is coming from -- its not
a class in the library. Based on the compiler error
it looks like the issue is using date_duration intead
of time duration with the time_period.

So instead you could do something like:

hours duration(24);

Or if you really want a class called days
you can do something like:

class days : public boost::posix_time::time_duration
{
public:
  days(int day_count) :
     boost::posix_time::time_duration(day_count*24)
  {}
};

HTH. And, BTW in the upcoming 1.30 release you will be
able to get rid of all the DATE_TIME_INLINE stuff...

Jeff


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