Index: trunk/BNC/RTCM3/ephemeris.cpp
===================================================================
--- trunk/BNC/RTCM3/ephemeris.cpp	(revision 2263)
+++ trunk/BNC/RTCM3/ephemeris.cpp	(revision 2285)
@@ -10,4 +10,5 @@
 #include "bncutils.h"
 #include "timeutils.h"
+#include "bnctime.h"
 
 using namespace std;
@@ -233,5 +234,5 @@
 int t_ephGlo::IOD() const {
 
-  bool old = true;
+  bool old = false;
 
   if (old) { // 5 LSBs of iod are equal to 5 LSBs of tb
@@ -242,5 +243,13 @@
   }
   else     {  
-    return int(fmod(_tki, 3600)) / 30;
+    bncTime tGPS(_GPSweek, _GPSweeks);
+    int hlpWeek = _GPSweek;
+    int hlpSec  = int(_GPSweeks);
+    int hlpMsec = int(_GPSweeks * 1000);
+    updatetime(&hlpWeek, &hlpSec, hlpMsec, 0);
+    bncTime tHlp(hlpWeek, hlpSec);
+    double diffSec = tGPS - tHlp;
+    bncTime tMoscow = tGPS + diffSec;
+    return int(tMoscow.daysec() / 900);
   }
 }
