Index: trunk/MagicSoft/Mars/mbase/MTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 8750)
+++ trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 8765)
@@ -426,4 +426,19 @@
 
     fMjd = mjd+1;
+}
+
+// --------------------------------------------------------------------------
+//
+// Set MTime to time expressed as float (yymmdd.ffff)
+//  for details see MAstro::Yymmdd2Mjd
+//
+void MTime::SetCorsikaTime(Float_t t)
+{
+    const UInt_t   yymmdd = (UInt_t)TMath::Floor(t);
+    const UInt_t   mjd    = MAstro::Yymmdd2Mjd(yymmdd);
+    const Double_t frac   = fmod(t, 1)*kDay; // [ms] Fraction of day
+    const UInt_t   ns     = (UInt_t)fmod(frac*1e6, 1000000);
+
+    SetMjd(mjd, (ULong_t)TMath::Floor(frac), ns);
 }
 
Index: trunk/MagicSoft/Mars/mbase/MTime.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTime.h	(revision 8750)
+++ trunk/MagicSoft/Mars/mbase/MTime.h	(revision 8765)
@@ -94,4 +94,5 @@
     Bool_t   SetSqlTimeStamp(const char *str);
     void     SetCT1Time(UInt_t mjd, UInt_t t1, UInt_t t0);
+    void     SetCorsikaTime(Float_t time);
     Bool_t   SetStringFmt(const char *time, const char *fmt, const char *loc=0);
     Bool_t   UpdMagicTime(Byte_t h, Byte_t m, Byte_t s, UInt_t ns);
