Boost logo

Boost Users :

From: Christian Henning (chhenning_at_[hidden])
Date: 2006-02-03 16:43:31

Hi there, I'm trying to format a time string based on a
local_time_facet. For some reason it isn't working as expected. Here
is the code (I basically copied from the Date Time IO Tutorial):

   ptime t( microsec_clock::local_time() );

   std::stringstream ss;

   local_time_facet* output_facet = new local_time_facet();
   ss.imbue( std::locale( std::locale::classic(), output_facet));

   output_facet->format("%a %b %d, %H:%M %z");
   ss << t;
   std::cout << ss.str() << std::endl;

The output isn't formated in the way it's specified. Cout will
basically spit out the same result as to_simple_string().

2006-Feb-03 16:38:57.046875

The expected result would something like this:

Fri Feb 3, 16:38 EDT

I'm using MSVC 7.1 and Boost 1.33.1.

Thanks in advance,

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at