Index: /trunk/BNC/upload/bncrtnetdecoder.cpp
===================================================================
--- /trunk/BNC/upload/bncrtnetdecoder.cpp	(revision 3185)
+++ /trunk/BNC/upload/bncrtnetdecoder.cpp	(revision 3186)
@@ -52,6 +52,4 @@
   bncSettings settings;
 
-  _year = 0;
-
   // List of upload casters
   // ----------------------
@@ -69,6 +67,8 @@
   QTextStream in(line.toAscii());
   QString hlp;
-  in >> hlp >> _year >> _month >> _day >> _hour >> _min >> _sec;
-  GPSweekFromYMDhms(_year, _month, _day, _hour, _min, _sec, _GPSweek, _GPSweeks);
+  int     year, month, day, hour, min;
+  double  sec;
+  in >> hlp >> year >> month >> day >> hour >> min >> sec;
+  _epoTime.set( year, month, day, hour, min, sec);
 }
 
@@ -91,5 +91,5 @@
         readEpochTime(hlpLines[ii]);
       }
-      else if (_year != 0) {
+      else if (_epoTime.valid()) {
         lines << hlpLines[ii];
       }
@@ -101,6 +101,5 @@
   if (lines.size() > 0) {
     for (int ic = 0; ic < _caster.size(); ic++) {
-      _caster.at(ic)->uploadClockOrbitBias(lines, _eph, _year, _month, _day,
-                                           _GPSweek, _GPSweeks);
+      _caster.at(ic)->uploadClockOrbitBias(_epoTime, _eph, lines);
     }
   }
Index: /trunk/BNC/upload/bncrtnetdecoder.h
===================================================================
--- /trunk/BNC/upload/bncrtnetdecoder.h	(revision 3185)
+++ /trunk/BNC/upload/bncrtnetdecoder.h	(revision 3186)
@@ -29,4 +29,5 @@
 #include <QtCore>
 #include "bncephuser.h"
+#include "bnctime.h"
 #include "bncuploadcaster.h"
 #include "RTCM/GPSDecoder.h"
@@ -41,12 +42,5 @@
   QList<bncUploadCaster*> _caster;
   QString                 _buffer;
-  int                     _GPSweek;
-  double                  _GPSweeks;
-  int                     _year;
-  int                     _month;
-  int                     _day;
-  int                     _hour;
-  int                     _min;
-  double                  _sec;
+  bncTime                 _epoTime;
 };
 
Index: /trunk/BNC/upload/bncuploadcaster.cpp
===================================================================
--- /trunk/BNC/upload/bncuploadcaster.cpp	(revision 3185)
+++ /trunk/BNC/upload/bncuploadcaster.cpp	(revision 3186)
@@ -262,15 +262,16 @@
 // Encode and Upload Clocks, Orbits, and Biases
 ////////////////////////////////////////////////////////////////////////////
-void bncUploadCaster::uploadClockOrbitBias(const QStringList& lines,
-                           const QMap<QString, bncEphUser::t_ephPair*>& ephMap,
-                           int year, int month, int day,
-                           int GPSweek, double GPSweeks) {
-
+void bncUploadCaster::uploadClockOrbitBias(const bncTime& epoTime, 
+                            const QMap<QString, bncEphUser::t_ephPair*>& ephMap,
+                            const QStringList& lines) {
   this->open();
+
+  unsigned year, month, day;
+  epoTime.civil_date(year, month, day);
   
   struct ClockOrbit co;
   memset(&co, 0, sizeof(co));
-  co.GPSEpochTime      = (int)GPSweeks;
-  co.GLONASSEpochTime  = (int)fmod(GPSweeks, 86400.0) 
+  co.GPSEpochTime      = static_cast<int>(epoTime.gpssec());
+  co.GLONASSEpochTime  = static_cast<int>(fmod(epoTime.gpssec(), 86400.0))
                        + 3 * 3600 - gnumleap(year, month, day);
   co.ClockDataSupplied = 1;
@@ -280,7 +281,6 @@
   struct Bias bias;
   memset(&bias, 0, sizeof(bias));
-  bias.GPSEpochTime      = (int)GPSweeks;
-  bias.GLONASSEpochTime  = (int)fmod(GPSweeks, 86400.0) 
-                         + 3 * 3600 - gnumleap(year, month, day);
+  bias.GPSEpochTime      = co.GPSEpochTime;
+  bias.GLONASSEpochTime  = co.GLONASSEpochTime;
   
   for (int ii = 0; ii < lines.size(); ii++) {
@@ -335,7 +335,7 @@
       if (sd) {
         QString outLine;
-        processSatellite(ep, GPSweek, GPSweeks, prn, xx, sd, outLine);
+        processSatellite(ep, epoTime.gpsw(), epoTime.gpssec(), prn, xx, sd, outLine);
         if (_outFile) {
-          _outFile->write(GPSweek, GPSweeks, outLine);
+          _outFile->write(epoTime.gpsw(), epoTime.gpssec(), outLine);
         }
       }
Index: /trunk/BNC/upload/bncuploadcaster.h
===================================================================
--- /trunk/BNC/upload/bncuploadcaster.h	(revision 3185)
+++ /trunk/BNC/upload/bncuploadcaster.h	(revision 3186)
@@ -4,4 +4,5 @@
 #include <QtNetwork>
 #include "bncephuser.h"
+#include "bnctime.h"
 
 class bncoutf;
@@ -24,8 +25,7 @@
   void printAscii(const QString& line);
   bool usedSocket() const {return _outSocket;}
-  void uploadClockOrbitBias(const QStringList& lines,
+  void uploadClockOrbitBias(const bncTime& epoTime, 
                             const QMap<QString, bncEphUser::t_ephPair*>& ephMap,
-                            int year, int month, int day,
-                            int GPSweek, double GPSweeks);
+                            const QStringList& lines);
 
  signals:
