- Timestamp:
- 06/02/13 15:52:07 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Time.cc
r16376 r16588 102 102 // 103 103 Time::Time(const time_t &tm, const suseconds_t &usec) 104 : ptime(fUnixOffset, time_duration(0, 0, tm, usec*pow(10, time_ of_day().num_fractional_digits()-6)))104 : ptime(fUnixOffset, time_duration(0, 0, tm, usec*pow(10, time_duration::num_fractional_digits()-6))) 105 105 { 106 106 } … … 114 114 //! 115 115 Time::Time(const timeval &tv) 116 : ptime(fUnixOffset, time_duration(0, 0, tv.tv_sec, tv.tv_usec*pow(10, time_ of_day().num_fractional_digits()-6)))116 : ptime(fUnixOffset, time_duration(0, 0, tv.tv_sec, tv.tv_usec*pow(10, time_duration::num_fractional_digits()-6))) 117 117 { 118 118 } … … 130 130 // Last argument is fractional_seconds ( correct with num_fractional_digits() ) 131 131 : ptime(boost::gregorian::date(year, month, day), 132 time_duration(hh, mm, ss, microsec*pow(10, time_ of_day().num_fractional_digits()-6)))132 time_duration(hh, mm, ss, microsec*pow(10, time_duration::num_fractional_digits()-6))) 133 133 { 134 134 } … … 152 152 mjd *= 24*60*60; 153 153 154 const int exp = time_of_day().num_fractional_digits(); 155 const double frac = fmod(mjd, 1)*pow(10, exp); 154 const double frac = fmod(mjd, 1)*pow(10, time_duration::num_fractional_digits()); 156 155 157 156 *this = ptime(fUnixOffset, time_duration(0, 0, mjd, frac)); … … 166 165 const time_duration tod = time_of_day(); 167 166 168 const int exp = tod.num_fractional_digits(); 169 170 const double frac = tod.fractional_seconds()/pow(10, exp); 167 const double frac = tod.fractional_seconds()/pow(10, time_duration::num_fractional_digits()); 171 168 const double sec = tod.total_seconds()+frac; 172 169
Note:
See TracChangeset
for help on using the changeset viewer.