Opened 9 years ago

#9186 new Bugs

posix_time and time zones

Reported by: kurt@… Owned by: az_sw_dude
Milestone: To Be Determined Component: date_time
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:

Description

Hi,

When I use something like: boost::posix_time::time_from_string("2013-09-29 23:36:54.565+02");

I end up with: terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::bad_lexical_cast> >'

what(): bad lexical cast: source type value could not be interpreted as target

Aborted

However, the following 2 do work: boost::posix_time::time_from_string("2013-09-29 23:36:54.565123+02"); boost::posix_time::time_from_string("2013-09-29 23:36:54.565");

It also doesn't seem to be doing anything with the +02. When I use to_tm() regardless of what is behind the +, I always get the 23 in tm_hour. The glibc extension tm_gmtoff is also always set to 0.

None of the functions that convert it to strings seem to be able to have a time zone in it.

I really don't understand why there isn't any support for time zones. A time without time zone seems to be totally useless to me.

PS: The documentation has 3 times tm_isddst in it instead of tm_isdst.

Change History (0)

Note: See TracTickets for help on using tickets.