Changeset 18445 for trunk/FACT++/src
- Timestamp:
- 02/17/16 14:03:38 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Time.cc
r16978 r18445 148 148 mjd -= 2400000.5; 149 149 150 // Convert MJD to seconds since offset150 // Convert MJD to ticks since offset 151 151 mjd -= 40587; 152 mjd *= 24*60*60; 153 154 const double frac = fmod(mjd, 1)*pow(10, time_duration::num_fractional_digits()); 155 156 *this = ptime(fUnixOffset, time_duration(0, 0, mjd, frac)); 152 mjd *= 24*60*60*time_duration::ticks_per_second(); 153 154 *this = ptime(fUnixOffset, time_duration(0, 0, 0, mjd)); 157 155 } 158 156 … … 165 163 const time_duration tod = time_of_day(); 166 164 167 const double frac = tod.fractional_seconds()/pow(10, time_duration::num_fractional_digits());165 const double frac = double(tod.fractional_seconds())/time_duration::ticks_per_second(); 168 166 const double sec = tod.total_seconds()+frac; 169 167
Note:
See TracChangeset
for help on using the changeset viewer.