
I'm experiencing a problem using custom formatting of fractional seconds.
const std::string date_string = "2006 Jun 01 999000 23.59.59";
const std::string format_string = "%Y %b %d %f %H.%M.%S";
When using a time_facet together with the "%f" flag, I get a correct output
containing a 6-digit number in place of the fractional part.
However, using a time_input_facet together with the "%f" flag, I cannot get
a correct ptime from an input using the same format as the above example.
The problem is twofold :
1) First, the input facet expects a leading '.'
otherwise, it parses a special value and fails.
[see time_facet.hpp(1035-1049)]
This is not the case in an output facet.
2) Second, even if I include a leading dot, the space
after the fractional seconds is not consumed, and
the parsing of the remainder fails.
This means that I need to add an extra space to the
input format string.
Here is a sample program:
---------
#include <cassert>
#include