
Hi, The following code looks pretty suspicious to me: extern const wchar_t* pts; // pts = L"2004071" std::wistringstream wiss(pts); wtime_input_facet* wtif = new wtime_input_facet; wtif->set_iso_format(); wiss.imbue(std::locale(std::locale::classic(), wtif)); ptime pt; wiss >> pt; std::string dbgs = to_iso_string(pt); // dbgs == "20040711T000000" Seems to be a bug? TIA -- Serge

Bart wrote:
No, it's not a typo. Actually, it's a part of a test. I expected an error. Here is a complete example for vc-7_1. #include <wchar.h> #include <sstream> #include <iostream> #include <boost/date_time/posix_time/posix_time.hpp> int main() { using namespace boost::posix_time; const wchar_t* pts = L"2004071"; std::wistringstream wiss(pts); wtime_input_facet* wtif = new wtime_input_facet; wtif->set_iso_format(); wiss.imbue(std::locale(std::locale::classic(), wtif)); ptime pt; wiss >> pt; std::string dbgs = to_iso_string(pt); // dbgs == "20040711T000000" std::cout << dbgs << "\n"; }
I get the same error when run the sample above:( -- Serge
participants (3)
-
Bart
-
Jeff Garland
-
Serge Skorokhodov