Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 3137)
+++ trunk/MagicSoft/Mars/Changelog	(revision 3138)
@@ -31,4 +31,15 @@
      - changed the name of the "DC" tree to "Currents" to make
        MReportRead work correctly with this tree
+
+   * mbase/MTime.[h,cc]:
+     - Changed UpDMagicTime to support nanosec instead of millisec
+
+   * mraw/MRawEvtHeader.[h,cc]:
+     - implemented decoding of the time-stamp for raw-data files
+       with version>2. Thanks to Marcos.
+
+   * mraw/MRawRead.[h,c]:
+     - pipe file version number to MRawEvtHeader::ReadEvt
+     - create fake time for file-version<3
 
 
Index: trunk/MagicSoft/Mars/mbase/MTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 3137)
+++ trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 3138)
@@ -141,5 +141,5 @@
         return kFALSE;
 
-    const Bool_t am = ms < kHour*13; // day of sunrise?
+    const Bool_t am = ms<kHour*13; // day of sunrise?
 
     fMjd     = am ? mjd : mjd + 1;
@@ -220,13 +220,13 @@
 // between 13:00:00.0 (day of dawning) and 12:59:59.999 (day of sunrise)
 //
-Bool_t MTime::UpdMagicTime(Byte_t h, Byte_t m, Byte_t s, UShort_t ms)
-{
-    if (h>23 || m>59 || s>59 || ms>999)
+Bool_t MTime::UpdMagicTime(Byte_t h, Byte_t m, Byte_t s, UInt_t ns)
+{
+    if (h>23 || m>59 || s>59 || ns>999999999)
          return kFALSE;
 
-    const ULong_t tm = ((((h*60+m)*60)+s)*1000)+ms;
-
-    fTime = (Long_t)(tm < kHour*13 ? tm  : tm-kDay); // day of sunrise?
-    //fNanoSec = ns;
+    const ULong_t tm = ((((h*60+m)*60)+s)*1000)+ns/1000000;
+
+    fTime = (Long_t)(tm<kHour*13 ? tm  : tm-kDay); // day of sunrise?
+    fNanoSec = ns%1000000;
 
     return kTRUE;
@@ -244,9 +244,9 @@
     struct timeval tv;
     if (gettimeofday(&tv, NULL)<0)
-        Reset();
+        Clear();
     else
         Set(tv);
 #else
-    Reset();
+    Clear();
 #endif
 }
Index: trunk/MagicSoft/Mars/mbase/MTime.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTime.h	(revision 3137)
+++ trunk/MagicSoft/Mars/mbase/MTime.h	(revision 3138)
@@ -49,5 +49,5 @@
     {
         Init(name, title);
-        Reset();
+        Clear();
     }
     MTime(const struct timeval &tm)
@@ -68,5 +68,5 @@
     }
 
-    void Reset() { fMjd=0; fTime=0; fNanoSec=0; }
+    void Clear(const Option_t *o="") { fMjd=0; fTime=0; fNanoSec=0; }
 
     void Print(Option_t *t=NULL) const;
@@ -78,5 +78,5 @@
     void     Set(const struct timeval &tv);
     void     SetCT1Time(UInt_t mjd, UInt_t t1, UInt_t t0);
-    Bool_t   UpdMagicTime(Byte_t h, Byte_t m, Byte_t s, UShort_t ms);
+    Bool_t   UpdMagicTime(Byte_t h, Byte_t m, Byte_t s, UInt_t ns);
     void     SetMjd(Double_t m);
     Double_t GetMjd() const;
