- Timestamp:
- Apr 26, 2008, 11:53:10 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bnsutils.cpp
r860 r861 98 98 void mjdFromDateAndTime(const QDateTime& dateTime, int& mjd, double& dayfrac) { 99 99 100 double mjddec = dateTime.date().toJulianDay() - 2400000.5 +101 (dateTime.time().hour() + 102 (dateTime.time().minute() +103 (dateTime.time().second() + 104 dateTime.time().msec() / 1000.0) / 60.0) / 60.0) / 24.0;105 106 mjd = int(mjddec);107 dayfrac = mjddec - mjd;100 const static QDate zeroDate(1858, 11, 17); 101 102 mjd = zeroDate.daysTo(dateTime.date()); 103 104 dayfrac = (dateTime.time().hour() + 105 (dateTime.time().minute() + 106 (dateTime.time().second() + 107 dateTime.time().msec() / 1000.0) / 60.0) / 60.0) / 24.0; 108 108 } 109 109
Note:
See TracChangeset
for help on using the changeset viewer.