Ignore:
Timestamp:
Nov 2, 2005, 9:52:39 AM (20 years ago)
Author:
ansari
Message:

1/ Correction bug TimeStamp::ToDays() + petites amelioration
2/ Prise en compte du type TimeStamp dans MuTyV (sous forme de r_8 en interne)
3/ Adaptation DVList a modifs MuTyV (typ TimeStamp) et R/W PPersist

+ Petites corrections et MAJ num.version , Reza 2 Nov 2005

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/timestamp.h

    r2654 r2826  
    3232  //! Constructor with specification of number of days since 0 Jan 1901 0h TU
    3333  TimeStamp(double days);
     34  //! Constructor from number of days (since 0/01/1901) and number of seconds
     35  TimeStamp(int_8 days, r_8 seconds);
    3436  //! Constructor with specification of day,month,year,hour,minutes,seconds
    3537  TimeStamp(int year, int month, int day, int hour, int min, double sec);
     
    4244  //! Sets the value of the time stamp from the number of days since 0 Jan 1901 0h TU
    4345  void Set(double days);
     46  //! Sets the value of the time stamp from the number of days and seconds
     47  void Set(int_8 days, r_8 seconds);
    4448  //! initialize with current date and time (GMT)
    4549  void SetNow();
     
    7074  //! Return the value of the TimeStamp as days.fraction_days since 0 Jan 1901
    7175  double ToDays() const;
    72   //! Conversion operator to double
     76  //! Conversion operator to double - return ToDays()
    7377  inline operator double() const { return ToDays(); }
    7478
    7579  //! Return the timestamp in string format
    76   string ToString() const;
     80  string ToString(bool fgday=true, bool fghour=true) const;
    7781 
    78   /*! Prints the date/time in string format on \b cout */
    79   inline  void    Print() const  { Print(cout); } 
    80   /*! Prints the date/time in string format on stream \b os */
    81   virtual void    Print(ostream& os)  const;
     82  //! Return the integral number of days since 0 Jan 1901
     83  inline int_8 DaysPart() { return mDays; }
     84  //! Return the fractional number of days in seconds ( 0 < nsec < 86400. )
     85  inline r_8 SecondsPart() { return mSeconds; }
    8286
    83   //!
     87  //! Prints the date/time in string format on \b cout
     88  inline  void    Print(bool fgday=true, bool fghour=true) const 
     89     { Print(cout, fgday, fghour); } 
     90  //! Prints the date/time in string format on stream \b os
     91  virtual void    Print(ostream& os, bool fgday=true, bool fghour=true)  const;
     92
    8493  //! Number of days in a given month 
    8594  static int   MonthDays(int year, int month);
Note: See TracChangeset for help on using the changeset viewer.