Changeset 2826 in Sophya for trunk/SophyaLib/BaseTools/timestamp.h
- Timestamp:
- Nov 2, 2005, 9:52:39 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/BaseTools/timestamp.h
r2654 r2826 32 32 //! Constructor with specification of number of days since 0 Jan 1901 0h TU 33 33 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); 34 36 //! Constructor with specification of day,month,year,hour,minutes,seconds 35 37 TimeStamp(int year, int month, int day, int hour, int min, double sec); … … 42 44 //! Sets the value of the time stamp from the number of days since 0 Jan 1901 0h TU 43 45 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); 44 48 //! initialize with current date and time (GMT) 45 49 void SetNow(); … … 70 74 //! Return the value of the TimeStamp as days.fraction_days since 0 Jan 1901 71 75 double ToDays() const; 72 //! Conversion operator to double 76 //! Conversion operator to double - return ToDays() 73 77 inline operator double() const { return ToDays(); } 74 78 75 79 //! Return the timestamp in string format 76 string ToString( ) const;80 string ToString(bool fgday=true, bool fghour=true) const; 77 81 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; } 82 86 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 84 93 //! Number of days in a given month 85 94 static int MonthDays(int year, int month);
Note:
See TracChangeset
for help on using the changeset viewer.