Boost logo

Boost Users :

From: Alejandro Escalante Medina (alejandro_escalante_medina_at_[hidden])
Date: 2003-02-27 16:41:33


Strange. I don't remember how I did find out it
existed, but here it is, in greg_duration.hpp:

typedef date_duration days;

So, it really is in the library :)

Well, after using hours() instead of days, it worked,
so, I now know what's wrong.

Thank you very much. I can't wait to see the upcoming
version. You've done a really great work, I'm grateful
cause it's making life easier for me in my current
assignment.

Alex

 --- Jeff Garland <jeff_at_[hidden]>
escribió:
---------------------------------
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

Yahoo! Groups Sponsor ADVERTISEMENT

Info: <http://www.boost.org>
Wiki:
<http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
Unsubscribe:
<mailto:boost-users-unsubscribe_at_[hidden]>

Your use of Yahoo! Groups is subject to the Yahoo!
Terms of Service.

_________________________________________________________
Do You Yahoo!?
La mejor conexión a internet y 25MB extra a tu correo por $100 al mes. http://net.yahoo.com.mx


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