Index: trunk/BNC/bncapp.cpp
===================================================================
--- trunk/BNC/bncapp.cpp	(revision 1154)
+++ trunk/BNC/bncapp.cpp	(revision 1155)
@@ -119,4 +119,6 @@
 
   _corrs = new QMultiMap<long, QString>;
+
+  _currentDateAndTimeGPS = 0;
 }
 
Index: trunk/BNC/bncapp.h
===================================================================
--- trunk/BNC/bncapp.h	(revision 1154)
+++ trunk/BNC/bncapp.h	(revision 1155)
@@ -42,4 +42,5 @@
     void setPortCorr(int port);
     void setCaster(bncCaster* caster) {_caster = caster;}
+    QDateTime* _currentDateAndTimeGPS;
   public slots:
     void slotMessage(const QByteArray msg);
Index: trunk/BNC/bncutils.cpp
===================================================================
--- trunk/BNC/bncutils.cpp	(revision 1154)
+++ trunk/BNC/bncutils.cpp	(revision 1155)
@@ -48,4 +48,5 @@
 
 #include "bncutils.h"
+#include "bncapp.h"
 
 using namespace std;
@@ -82,10 +83,22 @@
 void currentGPSWeeks(int& week, double& sec) {
 
-  QDateTime currDateTime = QDateTime::currentDateTime().toUTC();
+  QDateTime currDateTime;
+  int leapsecond = 0;
+
+  if ( ((bncApp*) qApp)->_currentDateAndTimeGPS ) {
+    currDateTime = *(((bncApp*) qApp)->_currentDateAndTimeGPS);
+  }
+  else {
+    currDateTime = QDateTime::currentDateTime().toUTC();
+    if (currDateTime.date().year() >= 2009) {
+      leapsecond = 15;
+    }
+    else {
+      leapsecond = 14;
+    }
+  }
+
   QDate     currDate = currDateTime.date();
   QTime     currTime = currDateTime.time();
-
-  int leapsecond = 14;
-  if (currDate.year() >= 2009) {leapsecond = 15;}
 
   week = int( (double(currDate.toJulianDay()) - 2444244.5) / 7 );
