Boost logo

Boost Users :

Subject: Re: [Boost-users] Date Time I/O formatting question
From: Commander Pirx (CmdPirx_at_[hidden])
Date: 2009-07-13 17:55:48


  "Polder, Matthew J" <matthew.j.polder_at_[hidden]> schrieb im Newsbeitrag news:BAC0789A8076D245A5651F65CCD2192B16184BED5C_at_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!



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net