Ignore:
Timestamp:
02/28/07 13:34:10 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MTime.cc

    r7550 r8337  
    108108// --------------------------------------------------------------------------
    109109//
     110// Constructor. Calls Set(y, m, d, h, min, s, ms, ns).
     111// To check validity test for (*this)==MTime()
     112//
     113MTime::MTime(UShort_t y, Byte_t m, Byte_t d, Byte_t h, Byte_t min, Byte_t s, UShort_t ms, UInt_t ns)
     114{
     115    Set(y, m, d, h, min, s, ms, ns);
     116}
     117
     118// --------------------------------------------------------------------------
     119//
    110120// Return date as year(y), month(m), day(d)
    111121//
     
    218228{
    219229    return (ULong_t)((GetMjd()-49718)*kDay);
     230}
     231
     232// --------------------------------------------------------------------------
     233//
     234// Return a time which is expressed in seconds since 01/01/1970 0:00h
     235// This is compatible with root's definition used in the constructor of
     236// TDatime.
     237//
     238TDatime MTime::GetRootDatime() const
     239{
     240    return TDatime((UInt_t)((GetMjd()-40587)*kDay/1000));
    220241}
    221242
  • trunk/MagicSoft/Mars/mbase/MTime.h

    r8066 r8337  
    6464    }
    6565    MTime(Double_t mjd);
     66    MTime(UShort_t y, Byte_t m, Byte_t d, Byte_t h=13, Byte_t min=0, Byte_t s=0, UShort_t ms=0, UInt_t ns=0);
    6667    MTime(const MTime& t) : MParContainer(), fMjd(t.fMjd), fTime(t.fTime), fNanoSec(t.fNanoSec)
    6768    {
    6869        Init(NULL, NULL);
    6970    }
     71
     72    //static Int_t Hour() { return 3600; }
     73    //static Int_t Day()  { return 3600;*24 }
    7074
    7175    void operator=(const MTime &t)
     
    108112    void     GetDateOfSunrise(UShort_t &y, Byte_t &m, Byte_t &d) const;
    109113    TTime    GetRootTime() const;
     114    TDatime  GetRootDatime() const;
    110115    Double_t GetAxisTime() const;
    111116    Double_t GetMoonPhase() const;
     
    143148    operator double() const;   //[s]
    144149    double operator()() const; //[s]
     150
     151    Double_t    AsDouble() const    { return GetMjd(); }
     152    //const char *AsString() const    { return GetString(); }
     153    //const char *AsSQLString() const { return GetSqldateTime(); }
    145154
    146155    // Calculation functions
Note: See TracChangeset for help on using the changeset viewer.