Index: trunk/BNC/RTCM3/RTCM3coDecoder.cpp
===================================================================
--- trunk/BNC/RTCM3/RTCM3coDecoder.cpp	(revision 1153)
+++ trunk/BNC/RTCM3/RTCM3coDecoder.cpp	(revision 1154)
@@ -86,5 +86,5 @@
     QSettings settings;
 
-    QDateTime datTim = QDateTime::currentDateTime().toUTC();
+    QDateTime datTim = currentDateAndTimeGPS();
 
     QString hlpStr = bncRinex::nextEpochStr(datTim,
Index: trunk/BNC/bncapp.cpp
===================================================================
--- trunk/BNC/bncapp.cpp	(revision 1153)
+++ trunk/BNC/bncapp.cpp	(revision 1154)
@@ -180,5 +180,5 @@
 
   if (_logStream) {
-    *_logStream << QDateTime::currentDateTime().toUTC().toString("yy-MM-dd hh:mm:ss ").toAscii().data();
+    *_logStream << currentDateAndTimeGPS().toString("yy-MM-dd hh:mm:ss ").toAscii().data();
     *_logStream << msg.data() << endl;
     _logStream->flush();
@@ -276,5 +276,5 @@
   if (!_ephPath.isEmpty()) {
 
-    QDateTime datTim = QDateTime::currentDateTime().toUTC();
+    QDateTime datTim = currentDateAndTimeGPS();
 
     QString ephFileNameGPS = _ephPath + "BRDC" + 
@@ -356,5 +356,5 @@
         *_ephStreamGPS << line;
         
-        QString hlp = QDateTime::currentDateTime().toUTC().toString("yyyyMMdd hhmmss UTC").leftJustified(20, ' ', true);
+        QString hlp = currentDateAndTimeGPS().toString("yyyyMMdd hhmmss UTC").leftJustified(20, ' ', true);
         *_ephStreamGPS << _pgmName.toAscii().data() 
                        << _userName.toAscii().data() 
@@ -378,5 +378,5 @@
         *_ephStreamGPS << line;
          
-        QString hlp = QDateTime::currentDateTime().toUTC().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
+        QString hlp = currentDateAndTimeGPS().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
         *_ephStreamGPS << _pgmName.toAscii().data() 
                        << _userName.toAscii().data() 
@@ -395,5 +395,5 @@
         *_ephStreamGlonass << line;
         
-        QString hlp = QDateTime::currentDateTime().toUTC().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
+        QString hlp = currentDateAndTimeGPS().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
         *_ephStreamGlonass << _pgmName.toAscii().data() 
                            << _userName.toAscii().data() 
Index: trunk/BNC/bncrinex.cpp
===================================================================
--- trunk/BNC/bncrinex.cpp	(revision 1153)
+++ trunk/BNC/bncrinex.cpp	(revision 1154)
@@ -236,5 +236,5 @@
   // --------------------
   else {
-    QDate currDate = QDateTime::currentDateTime().toUTC().date();
+    QDate currDate = currentDateAndTimeGPS().date();
     if ( !_skeletonDate.isValid() || _skeletonDate != currDate ) {
       if ( downloadSkeleton() == success) {
@@ -399,10 +399,10 @@
       if      (line.indexOf("PGM / RUN BY / DATE") != -1) {
         if (_rinexVers == 3) {
-          QString hlp = QDateTime::currentDateTime().toUTC().toString("yyyyMMdd hhmmss UTC").leftJustified(20, ' ', true);
+          QString hlp = currentDateAndTimeGPS().toString("yyyyMMdd hhmmss UTC").leftJustified(20, ' ', true);
           _out << _pgmName.toAscii().data() << _userName.toAscii().data() 
                << hlp.toAscii().data() << "PGM / RUN BY / DATE" << endl;
         }
         else {
-          QString hlp = QDateTime::currentDateTime().toUTC().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
+          QString hlp = currentDateAndTimeGPS().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
           _out << _pgmName.toAscii().data() << _userName.toAscii().data() 
                << hlp.toAscii().data() << "PGM / RUN BY / DATE" << endl;
@@ -453,5 +453,5 @@
     if (_rinexVers == 3) {
       _out << "     3.00           OBSERVATION DATA    M (MIXED)           RINEX VERSION / TYPE" << endl;
-      QString hlp = QDateTime::currentDateTime().toUTC().toString("yyyyMMdd hhmmss UTC").leftJustified(20, ' ', true);
+      QString hlp = currentDateAndTimeGPS().toString("yyyyMMdd hhmmss UTC").leftJustified(20, ' ', true);
       _out << _pgmName.toAscii().data() << _userName.toAscii().data() 
            << hlp.toAscii().data() << "PGM / RUN BY / DATE" << endl;
@@ -459,5 +459,5 @@
     else {
       _out << "     2.11           OBSERVATION DATA    M (MIXED)           RINEX VERSION / TYPE" << endl;
-      QString hlp = QDateTime::currentDateTime().toUTC().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
+      QString hlp = currentDateAndTimeGPS().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
       _out << _pgmName.toAscii().data() << _userName.toAscii().data() 
            << hlp.toAscii().data() << "PGM / RUN BY / DATE" << endl;
Index: trunk/BNC/bncutils.cpp
===================================================================
--- trunk/BNC/bncutils.cpp	(revision 1153)
+++ trunk/BNC/bncutils.cpp	(revision 1154)
@@ -98,2 +98,10 @@
         leapsecond;
 }
+
+QDateTime currentDateAndTimeGPS() {
+  int    GPSWeek;
+  double GPSWeeks;
+  currentGPSWeeks(GPSWeek, GPSWeeks);
+  return dateAndTimeFromGPSweek(GPSWeek, GPSWeeks);
+}
+
Index: trunk/BNC/bncutils.h
===================================================================
--- trunk/BNC/bncutils.h	(revision 1153)
+++ trunk/BNC/bncutils.h	(revision 1154)
@@ -35,3 +35,5 @@
 void currentGPSWeeks(int& week, double& sec);
 
+QDateTime currentDateAndTimeGPS();
+
 #endif
Index: trunk/BNC/bnczerodecoder.cpp
===================================================================
--- trunk/BNC/bnczerodecoder.cpp	(revision 1153)
+++ trunk/BNC/bnczerodecoder.cpp	(revision 1154)
@@ -71,5 +71,5 @@
 //////////////////////////////////////////////////////////////////////// 
 void bncZeroDecoder::reopen() {
-  QDate currDate = QDateTime::currentDateTime().toUTC().date();
+  QDate currDate = currentDateAndTimeGPS().date();
   if (!_out || _fileDate != currDate) {
     delete _out;
