The program below reads a date from a string -> istringstream -> ptime.
The string contains comma separated fields, the first of which is a date
in the format %Y-%m-%d (without %H:%M:%S):
2009-04-03,12.34,56.78
If I define a facet with in the format %Y-%m-%d %H:%M:%S then the program
outputs
2009-Apr-03 12:34:56
i.e. it interprets the numbers following the date as %H:%M:%S even though
they are separated by commas and dots, rather than colons.
Is this normal behaviour? Would it be possible to make it leave alone the
fields following the date? That is, do not interpret 12.34,56.78 as
%H:%M:%S.
Thanks!
// g++ -g -Wall -o dateIOSimgleFmt -I/usr/local/include/boost-1_38
dateIOSingleFmt.C
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <string>
#include