Re: [ROOT] Time Graphs. Need for another Date class in ROOT?

From: Damir Buskulic (buskulic@lapp.in2p3.fr)
Date: Tue May 23 2000 - 15:50:58 MEST


Hi Fons,

Wouldn't this bring some confusion ? We will have then three ways of
managing time : TDatime, TSDate, and time on axis. I understand very
well that they don't adress the same problem and Eddy's class is
certainly valuable. Perhaps some reflexion about a coherent approach
would be nice.

Cheers

Damir

Fons Rademakers wrote:
> 
> Hi Eddy,
> 
>   when you think your classes are fully debugged and properly commented,
> we would be happy to include them in ROOT.
> 
> Cheers, Fons.
> 
> Eddy Offermann wrote:
> >
> > Hi Steve,
> >
> > The class in my little example was to convert between dates given in
> > mm/dd/yy or mm/dd/yyyy format and business days (skipping saturdays and sundays).
> > Its use is probably only for the financial world, maybe interesting to incorporate
> > in a more general date time class. Its layout is as follows:
> >
> > #ifndef ROOT_DATE
> > #define ROOT_DATE
> >
> > //////////////////////////////////////////////////////////////////////////
> > //                                                                      //
> > // TSDate                                                               //
> > //                                                                      //
> > // Class implementing interface to convert between calender             //
> > //  and bussines days                                                   //
> > //                                                                      //
> > //////////////////////////////////////////////////////////////////////////
> >
> > #include <stdlib.h>
> >
> > #include "TObject.h"
> > #include "TMath.h"
> > #include "TString.h"
> >
> > class TSDate : public TObject
> > {
> >
> > protected:
> >   Long_t fBusinessDate; // business date number
> >
> >   void    Copy(TObject& obj);
> >
> > private:
> >   Long_t  JulianDateToBusinessDate(Long_t julianDate);
> >   Long_t  BusinessDateToJulianDate(Long_t businessDate);
> >   Long_t  StringToBusinessDate(const Char_t string[]);
> >   Long_t  StringToJulianDate(const Char_t string[]);
> >   Char_t* JulianDateToString(Long_t julianDate);
> >   Char_t* BusinessDateToString(Long_t businessDate);
> >   Int_t   FromString(const Char_t *string, Int_t &month, Int_t &day, Int_t &year);
> >
> > public:
> >   TSDate();
> >   TSDate(Long_t dayNr);
> >   TSDate(const Char_t* dayString);
> >   TSDate(const TSDate& date);
> >   virtual ~TSDate();
> >
> >   void    SetDate         (Long_t dayNr);
> >   void    SetDate         (const Char_t* dayString);
> >   Long_t  const GetDateNr () const { return fBusinessDate; }
> >   Int_t   const GetYear   ();
> >   Int_t   const GetMonth  ();
> >   Int_t   const GetDay    ();
> >   void    GetDateSpan     (Long_t dayNr, Int_t &dMonth, Int_t &dDay, Int_t &dYear);
> >   void    GetDateSpan     (const Char_t* dateString, Int_t &dMonth, Int_t &dDay, Int_t &dYear);
> >   const Char_t*
> >           GetDateString   ();
> >
> >           TSDate& operator=(const TSDate &date);
> >
> >   friend  TSDate  MinDate(TSDate &date1, TSDate &date2);
> >   friend  TSDate  MaxDate(TSDate &date1, TSDate &date2);
> >
> >   ClassDef(TSDate,0)  //Conversion from and to bussiness dates
> > };
> >
> > #endif
> >
> > Eddy
> 
> --
> Org:    CERN, European Laboratory for Particle Physics.
> Mail:   1211 Geneve 23, Switzerland
> E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
> WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7677910

-- 
=====================================================================
| Damir Buskulic                  | Universite de Savoie/LAPP       |
|                                 | Chemin de Bellevue, B.P. 110    |
| Tel : +33 (0)450091600          | F-74941 Annecy-le-Vieux Cedex   |
| e-mail: buskulic@lapp.in2p3.fr  | FRANCE                          |
=====================================================================
mailto:buskulic@lapp.in2p3.fr



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:25 MET