Re: [Boost-Users] Problem with time_period
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
... start omitted ... time_period p(ptime(date(2003, 03, 25)),
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
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@yahoogroups.com 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
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 :)
Yikes! It is very embarrassing when you lose track of you own 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.
You're welcome :-) Jeff
participants (2)
-
Alejandro Escalante Medina
-
Jeff Garland