Changeset 1036 in ntrip


Ignore:
Timestamp:
Aug 15, 2008, 6:38:33 PM (16 years ago)
Author:
weber
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncutils.cpp

    r464 r1036  
    9494        currTime.msec()                   / 1000.0;
    9595}
     96void leapsecGPSWeeks(int& week, double& sec) {
     97
     98  QDateTime currDateTime = QDateTime::currentDateTime().toUTC();
     99  QDate     currDate = currDateTime.date();
     100  QTime     currTime = currDateTime.time();
     101
     102  int leapsecond = 14;
     103  if (currDate.year() >= 2009) {leapsecond = 15;}
     104
     105  week = int( (double(currDate.toJulianDay()) - 2444244.5) / 7 );
     106
     107  sec = (currDate.dayOfWeek() % 7) * 24.0 * 3600.0 +
     108        currTime.hour()                   * 3600.0 +
     109        currTime.minute()                 *   60.0 +
     110        currTime.second()                          +
     111        currTime.msec()                   / 1000.0 +
     112        leapsecond;
     113}
Note: See TracChangeset for help on using the changeset viewer.