Ignore:
Timestamp:
08/10/04 16:03:01 (20 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

    r4452 r4563  
    113113// --------------------------------------------------------------------------
    114114//
     115// Return date as year(y), month(m), day(d). If the time is afternoon
     116// (>=13:00:00) the date of the next day is returned.
     117//
     118void MTime::GetDateOfSunrise(UShort_t &y, Byte_t &m, Byte_t &d) const
     119{
     120    MAstro::Mjd2Ymd(fMjd, y, m, d);
     121}
     122
     123// --------------------------------------------------------------------------
     124//
    115125// Return the time in the range [0h, 24h) = [0h0m0.000s - 23h59m59.999s]
    116126//
     
    227237void MTime::Set(const struct timeval &tv)
    228238{
    229     const UInt_t mjd = 1000*tv.tv_sec/kDay + 40587;
     239    const UInt_t mjd = (UInt_t)TMath::Floor(1000.*tv.tv_sec/kDay) + 40587;
     240
    230241    const Long_t tm  = tv.tv_sec%(24*3600)*1000 + tv.tv_usec/1000;
    231242    const UInt_t ms  = tv.tv_usec%1000;
  • trunk/MagicSoft/Mars/mbase/MTime.h

    r3967 r4563  
    9292    TString  GetFileName() const;
    9393    void     GetDate(UShort_t &y, Byte_t &m, Byte_t &d) const;
     94    void     GetDateOfSunrise(UShort_t &y, Byte_t &m, Byte_t &d) const;
    9495    TTime    GetRootTime() const;
    9596    Double_t GetAxisTime() const;
Note: See TracChangeset for help on using the changeset viewer.