date_time
date_time copied to clipboard
Boost.org date_time module
I'm trying to convert a boost::posix_time::ptime to a specific string format (extended ISO) and then back to a boost::posix_time::ptime. Surprisingly, it looks like for boost::posix_time::time_facet %f means 000000 to 999999...
This affects the upcoming 1.69.0 and likely earlier versions as well. Reproducible locally for me as well using fresh installations of both 32 and 64 bit cygwin. https://ci.appveyor.com/project/jeking3/date-time/builds/20626661
I have 32-bit std::time_t and boost 1.67 installed Visual Studio gives me warning C4244: 'return': conversion from '__int64' to 'time_t', possible loss of data at boost\date_time\posix_time\conversion.hpp The warning is raised...
Release: 1.64 At date_time/local_time/local_date_time.hpp:199 we have: tz->dst_local_start_time(d.year()).date(), tz->dst_local_start_time(d.year()).time_of_day(), tz->dst_local_end_time(d.year()).date(), tz->dst_local_end_time(d.year()).time_of_day(), tz->dst_offset() We did some performance evaluation and found that caching d.year(), dst_local_start_time() and dst_local_end_time() improved performance substantially.
https://travis-ci.org/boostorg/date_time/jobs/330925380#L1373 testing.capture-output ../../bin.v2/libs/date_time/test/testmicrosec_time_clock.test/gcc-7/debug/cxxstd-03-iso/testmicrosec_time_clock.run ====== BEGIN OUTPUT ====== 2018-Jan-20 01:55:59 2018-Jan-20 01:55:59.911262000 Pass :: hours match Pass :: minutes match Pass :: seconds match Pass :: hours date ...failed testing.capture-output ../../bin.v2/libs/date_time/test/testmicrosec_time_clock.test/gcc-7/debug/cxxstd-03-iso/testmicrosec_time_clock.run......
This is part of the effort to make the Boost libraries "modular" for build and consumption. See https://lists.boost.org/Archives/boost/2024/01/255704.php and https://github.com/grafikrobot/boost-b2-modular/blob/b2-modular/README.adoc for more information. This PR depends on the following other...
[Boost documentation](https://www.boost.org/doc/libs/1_86_0/doc/html/date_time/local_time.html#posix_time_zone_intro) states that (emphasis mine) > A posix_time_zone is unique in that the object is created from a Posix time zone string (IEEE Std 1003.1). [...] "MST-7" [...] lies...
We have an routine that parses date-time strings coming in over protocol. The code used is: ``` boost::posix_time::ptime stringToDateTime(const std::string& string) { static std::locale locale(std::locale::classic(), new boost::local_time::local_time_input_facet("%Y-%m-%d %H:%M:%S%F%ZP")); std::istringstream stream(string);...