Index: XIOS/trunk/src/config/file_attribute.conf
===================================================================
--- XIOS/trunk/src/config/file_attribute.conf	(revision 1043)
+++ XIOS/trunk/src/config/file_attribute.conf	(revision 1044)
@@ -19,4 +19,5 @@
 DECLARE_ENUM4(time_counter,  centered, instant, record, none)
 DECLARE_ATTRIBUTE(StdString, time_counter_name)
+DECLARE_ENUM2(time_units, seconds, days)
 DECLARE_ATTRIBUTE(int,       record_offset)
 DECLARE_ATTRIBUTE(bool,       cyclic)
Index: XIOS/trunk/src/io/nc4_data_output.cpp
===================================================================
--- XIOS/trunk/src/io/nc4_data_output.cpp	(revision 1043)
+++ XIOS/trunk/src/io/nc4_data_output.cpp	(revision 1044)
@@ -1984,5 +1984,9 @@
               field->getOperationTimeType() != func::CFunctor::once)
           {
-            field->resetNStep(getRecordFromTime(field->last_Write_srv) + 1);
+			 double factorUnit;
+			 if (!field->file->time_units.isEmpty() && field->file->time_units==CFile::time_units_attr::days)
+			   factorUnit=context->getCalendar()->getDayLengthInSeconds() ; 
+			 else factorUnit=1 ;
+            field->resetNStep(getRecordFromTime(field->last_Write_srv,factorUnit) + 1);
           }
 
@@ -2047,4 +2051,15 @@
           else if (field->file->time_counter == CFile::time_counter_attr::record)
             time_counter_bound(0) = time_counter_bound(1) = field->getNStep() - 1;
+
+
+
+          if (!field->file->time_units.isEmpty() && field->file->time_units==CFile::time_units_attr::days)
+          {
+            double secByDay=context->getCalendar()->getDayLengthInSeconds() ;
+            time_data/=secByDay;
+            time_data_bound/=secByDay;
+            time_counter/=secByDay;
+            time_counter_bound/=secByDay;
+          }
         }
 
@@ -2271,4 +2286,8 @@
          StdString timeid(getTimeCounterName());
          StdString timeBoundId("axis_nbounds");
+
+         StdString strTimeUnits ;
+         if (!field->file->time_units.isEmpty() && field->file->time_units==CFile::time_units_attr::days) strTimeUnits="days since " ;
+         else  strTimeUnits="seconds since " ;
  
          if (field->getOperationTimeType() == func::CFunctor::instant)
@@ -2300,6 +2319,5 @@
               StdString strTimeOrigin=timeOrigin.toString() ;
               this->writeTimeAxisAttributes
-                 (axisid, cal->getType(),
-                  StdString("seconds since ").append(strTimeOrigin),
+                 (axisid, cal->getType(),strTimeUnits+strTimeOrigin,
                   strTimeOrigin, axisBoundId);
            }
@@ -2334,5 +2352,5 @@
 
                   this->writeTimeAxisAttributes(axisid, cal->getType(),
-                                                StdString("seconds since ").append(strTimeOrigin),
+                                                strTimeUnits+strTimeOrigin,
                                                 strTimeOrigin, axisBoundId);
                 }
@@ -2569,5 +2587,5 @@
       ///--------------------------------------------------------------
 
-      StdSize CNc4DataOutput::getRecordFromTime(Time time)
+      StdSize CNc4DataOutput::getRecordFromTime(Time time, double factorUnit)
       {
         std::map<Time, StdSize>::const_iterator it = timeToRecordCache.find(time);
@@ -2580,5 +2598,6 @@
           CArray<double,2> timeAxisBounds;
           SuperClassWriter::getTimeAxisBounds(timeAxisBounds, timeAxisBoundsId, isCollective);
-
+          timeAxisBounds*=factorUnit ;
+          
           StdSize record = 0;
           double dtime(time);
Index: XIOS/trunk/src/io/nc4_data_output.hpp
===================================================================
--- XIOS/trunk/src/io/nc4_data_output.hpp	(revision 1043)
+++ XIOS/trunk/src/io/nc4_data_output.hpp	(revision 1044)
@@ -96,5 +96,5 @@
                                      const StdString & nav_model);
 
-            StdSize getRecordFromTime(Time time);
+            StdSize getRecordFromTime(Time time, double factorUnit);
 
          private :
