Index: trunk/BNC/src/bncgetthread.cpp
===================================================================
--- trunk/BNC/src/bncgetthread.cpp	(revision 8414)
+++ trunk/BNC/src/bncgetthread.cpp	(revision 8417)
@@ -56,4 +56,5 @@
 #include "bnccore.h"
 #include "bncutils.h"
+#include "bnctime.h"
 #include "bnczerodecoder.h"
 #include "bncnetqueryv0.h"
@@ -624,17 +625,14 @@
         if (!_rawFile) {
           QString prn(obs._prn.toString().c_str());
-          long iSec = long(floor(obs._time.gpssec() + 0.5));
-          long obsTime = obs._time.gpsw() * 7 * 24 * 3600 + iSec;
-          QMap<QString, long>::const_iterator it = _prnLastEpo.find(prn);
+          bncTime obsTime = obs._time;
+          QMap<QString, bncTime>::const_iterator it = _prnLastEpo.find(prn);
           if (it != _prnLastEpo.end()) {
-            long oldTime = it.value();
+            bncTime oldTime = it.value();
             if (obsTime < oldTime) {
-              emit(newMessage(_staID + ": old observation " + prn.toLatin1(),
-                  false));
+              emit(newMessage(_staID + ": old observation " + prn.toLatin1(), false));
               continue;
             } else if (obsTime == oldTime) {
-              emit(newMessage(
-                  _staID + ": observation coming more than once "
-                      + prn.toLatin1(), false));
+              emit(newMessage(_staID + ": observation coming more than once "
+                              + prn.toLatin1(), false));
               continue;
             }
Index: trunk/BNC/src/bncgetthread.h
===================================================================
--- trunk/BNC/src/bncgetthread.h	(revision 8414)
+++ trunk/BNC/src/bncgetthread.h	(revision 8417)
@@ -139,5 +139,5 @@
    bool                       _rawOutput;
    bool                       _latencycheck;
-   QMap<QString, long>        _prnLastEpo;
+   QMap<QString, bncTime>     _prnLastEpo;
    QMap<char, QVector<QString> > _rnxTypes;
    QStringList                _gloSlots;
Index: trunk/BNC/src/bncrinex.cpp
===================================================================
--- trunk/BNC/src/bncrinex.cpp	(revision 8414)
+++ trunk/BNC/src/bncrinex.cpp	(revision 8417)
@@ -496,5 +496,5 @@
   // -------------
   const t_satObs& fObs = obsList.first();
-  QDateTime datTimNom  = dateAndTimeFromGPSweek(fObs._time.gpsw(), floor(fObs._time.gpssec()+0.5));
+  QDateTime datTimNom  = dateAndTimeFromGPSweek(fObs._time.gpsw(), fObs._time.gpssec());
 
   // Close the file
Index: trunk/BNC/src/bnctime.cpp
===================================================================
--- trunk/BNC/src/bnctime.cpp	(revision 8414)
+++ trunk/BNC/src/bnctime.cpp	(revision 8417)
@@ -6,4 +6,5 @@
 #include <sstream>
 #include <iomanip>
+#include <iostream>
 
 #include "bnctime.h"
@@ -82,5 +83,5 @@
   if(msec/1000.0 < sec - 86400.0)
     ++week;
-  return set(week, msec/1000.0);
+  return set(week, double(msec/1000.0));
 }
 
@@ -118,5 +119,5 @@
   intsec = sec;
   updatetime(&week, &intsec, msec, 0); /* Moscow -> GPS */
-  sec = intsec+(msec%1000)/1000.0;
+  sec = intsec+double((msec%1000)/1000.0);
   return set(week, sec);
 }
@@ -132,7 +133,8 @@
     msec -= 7*24*60*60*1000;
   currentGPSWeeks(week, sec);
-  if(msec/1000.0 < sec - 86400.0)
+  if((msec/1000.0) < (sec - 86400.0)) {
     ++week;
-  return set(week, msec/1000.0);
+  }
+  return set(week, double(msec/1000.0));
 }
 
Index: trunk/BNC/src/bncutils.cpp
===================================================================
--- trunk/BNC/src/bncutils.cpp	(revision 8414)
+++ trunk/BNC/src/bncutils.cpp	(revision 8417)
@@ -251,10 +251,9 @@
 bool checkForWrongObsEpoch(bncTime obsEpoch) {
   const double maxDt = 600.0;
-  long iSec    = long(floor(obsEpoch.gpssec()+0.5));
-  long obsTime = obsEpoch.gpsw()*7*24*3600 + iSec;
+  bncTime obsTime = obsEpoch;
   int    week;
   double sec;
   currentGPSWeeks(week, sec);
-  long currTime = week * 7*24*3600 + long(sec);
+  bncTime currTime(week, sec);
 
   if (fabs(currTime - obsTime) > maxDt) {
@@ -575,5 +574,5 @@
   const ColumnVector& yi, // vector of the initial y-values
   double dx,              // the step size for the integration
-  double* acc,            // aditional acceleration
+  double* acc,            // additional acceleration
   ColumnVector (*der)(double x, const ColumnVector& y, double* acc)
                           // A pointer to a function that computes the
