"Polder, Matthew J" <matthew.j.polder@lmco.com> schrieb im Newsbeitrag news:BAC0789A8076D245A5651F65CCD2192B16184BED5C@HVXMSP5.us.lmco.com...

 

I’ve found the Date Time library incredibly useful for dealing with timestamps, but I can’t seem to get the output formatted the way I want. I’ve followed the example for the Date Time IO Tutorial (http://www.boost.org/doc/libs/1_39_0/doc/html/date_time/date_time_io.html#date_time.io_tutorial) but the output always comes out the same way. I’ve tried the following code with Visual Studio Express 2008 and g++ 4.2 on Solaris 10. I’m using Boost 1.39.0. Any help appreciated.

 

matthew

 

 

#include <fstream>

#include <functional>

#include <iostream>

#include <sstream>

#include "boost/date_time/gregorian/gregorian.hpp"

#include "boost/date_time/posix_time/posix_time.hpp"

#include "boost/date_time/local_time/local_time.hpp"

 

using namespace std;

 

int main(int argc, char** argv)

{

      stringstream ss;

 

      ifstream in( argv[1] );

 

      string inputFormat = argv[2];

      string outputFormat = argv[3]; //I want my own formatting.

           

 

Would be interesting whats your format string looks like. Not all format flags work with all date_time classes. %z (Time zone) for instance works only with local_date_time.

 

Pirx!