Boost logo

Boost :

Subject: Re: [boost] [date time] std::out_of_range thrown on date 2012-5-29
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-08-08 03:46:22


On Thu, Aug 8, 2013 at 11:13 AM, Matthijs Möhlmann
<matthijs_at_[hidden]> wrote:
> Hello all,
>
> Following piece of program gives a std::out_of_range exception:
>
> #include <boost/date_time/posix_time/posix_time.hpp>
>
> int main(int argc, char **argv) {
>
> boost::posix_time::ptime datetime;
> datetime = boost::posix_time::time_from_string("2012-5-29");
> return 0;
> }

>From the docs it seems you're missing time in the string:

http://www.boost.org/doc/libs/1_54_0/doc/html/date_time/posix_time.html#date_time.posix_time.ptime_class

Search for time_from_string. I don't think this is a bug, although the
exception could have been more descriptive.

> Where can I officially report bugs?

https://svn.boost.org/trac/boost/


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk