Index: /XIOS/trunk/bld.cfg
===================================================================
--- /XIOS/trunk/bld.cfg	(revision 315)
+++ /XIOS/trunk/bld.cfg	(revision 316)
@@ -25,7 +25,9 @@
 search_src           true
 src::zzz .
+src::date $PWD/extern/boost/src/date_time
 bld::lib xios
 bld::target libxios.a
-bld::target generate_fortran_interface.exe 
+#bld::target test.exe
+#bld::target generate_fortran_interface.exe 
 bld::target xios_server.exe test_cs.exe 
 bld::exe_dep
Index: /XIOS/trunk/src/date.cpp
===================================================================
--- /XIOS/trunk/src/date.cpp	(revision 315)
+++ /XIOS/trunk/src/date.cpp	(revision 316)
@@ -1,4 +1,9 @@
 #include "date.hpp"
 #include "calendar.hpp"
+#include <boost/date_time/gregorian/gregorian.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+
+using namespace boost::posix_time ;
+using namespace boost::gregorian ;
 
 namespace xmlioserver
@@ -48,18 +53,14 @@
       StdOStream & operator<<(StdOStream & out, const CDate & date)
       {
-         std::streamsize s = out.width (2);
-         char c = out.fill ('0');
-         out << date.day << '/';
-         s = out.width (2); c = out.fill ('0');
-         out << date.month << '/';
-         s = out.width (4); c = out.fill ('0');
-         out << date.year << '-';
-         s = out.width (2); c = out.fill ('0');
-         out << date.hour << ':';
-         s = out.width (2); c = out.fill ('0');
-         out << date.minute << ':';
-         s = out.width (2); c = out.fill ('0');
-         out << date.second;
+         std::streamsize s ; 
+         char c ;
          
+         s = out.width (4);  c = out.fill ('0') ; out << date.year << '-';
+         s = out.width (2);  c = out.fill ('0') ; out << date.month << '-';
+         s = out.width (2);  c = out.fill ('0') ; out << date.day << ' ';
+         s = out.width (2);  c = out.fill ('0') ; out << date.hour << ':';
+         s = out.width (2);  c = out.fill ('0') ; out << date.minute << ':';
+         s = out.width (2);  c = out.fill ('0') ; out << date.second ;
+
          return (out);
       }
@@ -67,14 +68,36 @@
       StdIStream & operator>>(StdIStream & in, CDate & date) // Non testÃ©e.
       {
-         char c = '/'; // Le caractÃšre c est utilisÃ© pour "recueillir" les sÃ©parateurs "/" et ":".
-         in >> date.day  >> c >> date.month  >> c >> date.year   >> c;
-         in >> date.hour >> c >> date.minute >> c >> date.second;
-         if(!date.checkDate())
-         {
-            DEBUG("La date initialisÃ©e (depuis une chaÃ®ne de caractÃšres) "
-                  << "a Ã©tÃ© modifiÃ©e car elle Ã©tait incorrecte "
-                  << "par rapport au calendrier souhaitÃ©.");
-         }
-         return (in);
+        char sep = '-'; // Le caractÃšre c est utilisÃ© pour "recueillir" les sÃ©parateurs "/" et ":".
+        char c ;
+         
+        in >> date.year >> c ;
+        if (c==sep)
+        {
+          in >> date.month >> c ;
+          if (c==sep)
+          {
+            in >> date.day  ;
+            c=in.get();
+            sep=' ' ;
+            if (c==sep)
+            {
+              in >> date.hour >> c ;
+              sep=':' ;
+              if (c==sep) 
+              {
+                in>>date.minute >> c;
+                if (c==sep)
+                {
+                  in>>date.second ;
+                  if(!date.checkDate())
+                    ERROR("StdIStream & operator >> (StdIStream & in, CDate & date)",<<"Bad date format or not conform to calendar" );
+                    return (in);
+                }
+              }
+            }
+          }
+        }
+        ERROR("StdIStream & operator >> (StdIStream & in, CDate & date)",<<"Bad date format or not conform to calendar" );
+        return (in);
       }
 
Index: /XIOS/trunk/src/output/nc4_data_output.cpp
===================================================================
--- /XIOS/trunk/src/output/nc4_data_output.cpp	(revision 315)
+++ /XIOS/trunk/src/output/nc4_data_output.cpp	(revision 316)
@@ -563,8 +563,9 @@
             SuperClassWriter::addVariable(axisid, NC_DOUBLE, dims);
             date::CDate initDate=cal->getInitDate() ;
-            StdOStringStream oss2;
-            oss2<<initDate.getYear()<<"-"<<initDate.getMonth()<<"-"<<initDate.getDay()<<" "
-                <<initDate.getHour()<<"-"<<initDate.getMinute()<<"-"<<initDate.getSecond() ;
-            StdString strInitdate=oss2.str() ;
+//            StdOStringStream oss2;
+//            oss2<<initDate.getYear()<<"-"<<initDate.getMonth()<<"-"<<initDate.getDay()<<" "
+//                <<initDate.getHour()<<"-"<<initDate.getMinute()<<"-"<<initDate.getSecond() ;
+//            StdString strInitdate=oss2.str() ;
+            StdString strInitdate=initDate.toString() ;
             this->writeTimeAxisAttributes
                (axisid, cal->getType(),
Index: /XIOS/trunk/src/test/test.cpp
===================================================================
--- /XIOS/trunk/src/test/test.cpp	(revision 315)
+++ /XIOS/trunk/src/test/test.cpp	(revision 316)
@@ -3,27 +3,18 @@
 #include <string>
 
+#include <boost/date_time/gregorian/gregorian.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+
 using namespace std ;
-
-
-class CLog : public ostream
-{
-   public :
-   CLog() : ostream(NULL),level(0) {}
-   CLog& operator()(int l) {if (l<=level) rdbuf(cout.rdbuf()) ; else rdbuf(NULL) ; return *this;}
-   void setLevel(int l) {level=l; } 
-   int level ;
-//   ostringstream& getStream() { return *(ostringstream*)(this) ; }
-//   ~CLog(void) { cout<<"info message "<< this->str();}
-};
-
+using namespace boost::posix_time ;
+using namespace boost::gregorian ;
 
 int main(void)
 {
-  CLog out ;
-  cout<<string("toto")<<endl ;
-  out<<"123"<<endl ;
-  out.setLevel(5) ;
-  out(7)<<"coucou 1"<<endl ;
-  out(3)<<"coucou 2"<<endl<<"i23"<<endl ;
-  
+      ptime t(time_from_string("2012-02-30 15:24")) ;
+      
+       
+      std::cout << to_simple_string(t) << std::endl;
+
+  return 1 ;  
 }
Index: /XIOS/trunk/src/test/test_cs.f90
===================================================================
--- /XIOS/trunk/src/test/test_cs.f90	(revision 315)
+++ /XIOS/trunk/src/test/test_cs.f90	(revision 316)
@@ -77,5 +77,5 @@
   CALL xios_set_context_attr("test",calendar_type="Gregorian") 
   CALL xios_set_context_attr("test",calendar_type="Gregorian") 
-  CALL xios_set_context_attr("test",start_date="01/01/2000 - 00:00:00")
+!  CALL xios_set_context_attr("test",start_date="01/01/2000 - 00:00:00")
   CALL xios_set_context_attr("test",calendar_type="Gregorian") 
   CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj)
