FACT++  1.0
void Time::Mjd ( double  mjd)

Set the Time object to a given MJD. Note that this involves conversion from double. So converting forth and back many many times might results in drifts.

Parameters
mjdModified Julian Date
Examples:
time.cc.

Definition at line 145 of file Time.cc.

References fUnixOffset.

Referenced by StateMachineRateControl::CalibrateRun(), DataLogger::DataLogger(), StateMachineDrive< T, S >::Execute(), StateMachineRateControl::HandleCalibratedCurrents(), StateMachineDrive< T, S >::HandleTPoint(), StateMachineDrive< T, S >::InitTracking(), StateMachineFeedback::LoadCalibration(), main(), Fits::Open(), StateMachineRateControl::ProcessCamera(), ConnectionGPS::Request(), StateMachineFeedback::SaveCalibration(), StateMachineDrive< T, S >::TrackingLoop(), and MessageImp::Write().

146 {
147  if (mjd > 2400000.5)
148  mjd -= 2400000.5;
149 
150  // Convert MJD to ticks since offset
151  mjd -= 40587;
152  mjd *= 24*60*60*time_duration::ticks_per_second();
153 
154  *this = ptime(fUnixOffset, time_duration(0, 0, 0, mjd));
155 }
static const boost::gregorian::date fUnixOffset
Points to the famous 1/1/1970, the standard offset for unix times.
Definition: Time.h:58

+ Here is the caller graph for this function: