Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 9207)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 9208)
@@ -32,2 +32,7 @@
    * star.cc:
      - removed obsolete -ff option from output
+
+   * mbase/MTime.[h,cc]:
+     - added GetBinary
+     - added WriteBinary
+
Index: /trunk/MagicSoft/Mars/mbase/MTime.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 9207)
+++ /trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 9208)
@@ -886,4 +886,8 @@
 } 
 
+// --------------------------------------------------------------------------
+//
+// Calls Set(t[0], t[1], t[2], t[3], t[4], t[5], 0)
+//
 Bool_t MTime::SetBinary(const UInt_t t[6])
 {
@@ -891,4 +895,34 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Assign:
+//    t[0] = year;
+//    t[1] = month;
+//    t[2] = day;
+//    t[3] = hour;
+//    t[4] = minute;
+//    t[5] = second;
+//
+void MTime::GetBinary(UInt_t t[6]) const
+{
+    UShort_t yea, ms;
+    Byte_t mon, day, h, m, s;
+
+    GetDate(yea, mon, day);
+    GetTime(h, m, s, ms);
+
+    t[0] = yea;
+    t[1] = mon;
+    t[2] = day;
+    t[3] = h;
+    t[4] = m;
+    t[5] = s;
+}
+
+// --------------------------------------------------------------------------
+//
+// Read seven bytes representing y, m, d, h, m, s
+//
 istream &MTime::ReadBinary(istream &fin)
 {
@@ -908,4 +942,24 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Write seven bytes representing y, m, d, h, m, s
+//
+ostream &MTime::WriteBinary(ostream &out) const
+{
+    UShort_t y, ms;
+    Byte_t mon, d, h, m, s;
+
+    GetDate(y, mon, d);
+    GetTime(h, m, s, ms);
+
+    out.read((char*)&y,   2);
+    out.read((char*)&mon, 1);
+    out.read((char*)&d,   1);
+    out.read((char*)&h,   1);
+    out.read((char*)&m,   1);
+    out.read((char*)&s,   1); // Total=7
+}
+
 void MTime::AddMilliSeconds(UInt_t ms)
 {
Index: /trunk/MagicSoft/Mars/mbase/MTime.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MTime.h	(revision 9207)
+++ /trunk/MagicSoft/Mars/mbase/MTime.h	(revision 9208)
@@ -118,4 +118,5 @@
     TString  GetSqlTimeStamp() const;
     TString  GetFileName() const;
+    void     GetBinary(UInt_t t[6]) const;
     void     GetDate(UShort_t &y, Byte_t &m, Byte_t &d) const;
     MTime    GetDateOfSunrise() const;
@@ -154,4 +155,5 @@
     // I/O functions
     istream &ReadBinary(istream &fin);
+    ostream &WriteBinary(ostream &out) const;
 
     void AsciiRead(istream &fin);
