Index: /trunk/Mars/mbase/MTime.cc
===================================================================
--- /trunk/Mars/mbase/MTime.cc	(revision 12936)
+++ /trunk/Mars/mbase/MTime.cc	(revision 12937)
@@ -229,4 +229,14 @@
 {
     SetMjd(MAstro::GetMagicPeriodStart(p));
+}
+
+UInt_t MTime::GetNightAsInt() const
+{
+    UShort_t y;
+    Byte_t m, d;
+
+    MAstro::Mjd2Ymd(fMjd+0.5, y, m, d);
+
+    return UInt_t(y)*10000 + UInt_t(m)*100 + d;
 }
 
Index: /trunk/Mars/mbase/MTime.h
===================================================================
--- /trunk/Mars/mbase/MTime.h	(revision 12936)
+++ /trunk/Mars/mbase/MTime.h	(revision 12937)
@@ -128,4 +128,5 @@
     Double_t GetMoonPeriod() const;
     Int_t    GetMagicPeriod() const;
+    UInt_t   GetNightAsInt() const;
     Long_t   GetTime() const { return (Long_t)fTime; } // [ms] Time of Day returned in the range [-11h, 13h)
     void     GetTime(Byte_t &h, Byte_t &m, Byte_t &s, UShort_t &ms) const;
