Index: /trunk/BNC/bncmodel.cpp
===================================================================
--- /trunk/BNC/bncmodel.cpp	(revision 2565)
+++ /trunk/BNC/bncmodel.cpp	(revision 2566)
@@ -772,28 +772,38 @@
   }   
 
+  string datestr = epoData->tt.datestr(0); // yyyymmdd
+  ostringstream strRMC;
+  strRMC.setf(ios::fixed);
+  strRMC << "GPRMC," 
+         << epoData->tt.timestr(0,0) << ",A,"
+         << setw(2) << setfill('0') << int(phiDeg) 
+         << setw(6) << setprecision(3) << setfill('0') 
+         << fmod(60*phiDeg,60) << ',' << phiCh << ','
+         << setw(3) << setfill('0') << int(lamDeg) 
+         << setw(6) << setprecision(3) << setfill('0') 
+         << fmod(60*lamDeg,60) << ',' << lamCh << ",,,"
+         <<  datestr[6] << datestr[7]
+         <<  datestr[4] << datestr[5]
+         <<  datestr[2] << datestr[3] << ",,,";
+
+  writeNMEAstr(QString(strRMC.str().c_str()));
+
   double dop = 2.0; // TODO 
 
-  ostringstream str3;
-  str3.setf(ios::fixed);
-  str3 << "GPGGA," 
-       << epoData->tt.timestr(0,0) << ','
-       << setw(2) << setfill('0') << int(phiDeg) 
-       << setw(10) << setprecision(7) << setfill('0') 
-       << fmod(60*phiDeg,60) << ',' << phiCh << ','
-       << setw(2) << setfill('0') << int(lamDeg) 
-       << setw(10) << setprecision(7) << setfill('0') 
-       << fmod(60*lamDeg,60) << ',' << lamCh 
-       << ",1," << setw(2) << setfill('0') << epoData->sizeAll() << ','
-       << setw(3) << setprecision(1) << dop << ','
-       << setprecision(3) << ell[2] << ",M,0.0,M,,,";
+  ostringstream strGGA;
+  strGGA.setf(ios::fixed);
+  strGGA << "GPGGA," 
+         << epoData->tt.timestr(0,0) << ','
+         << setw(2) << setfill('0') << int(phiDeg) 
+         << setw(10) << setprecision(7) << setfill('0') 
+         << fmod(60*phiDeg,60) << ',' << phiCh << ','
+         << setw(3) << setfill('0') << int(lamDeg) 
+         << setw(10) << setprecision(7) << setfill('0') 
+         << fmod(60*lamDeg,60) << ',' << lamCh 
+         << ",1," << setw(2) << setfill('0') << epoData->sizeAll() << ','
+         << setw(3) << setprecision(1) << dop << ','
+         << setprecision(3) << ell[2] << ",M,0.0,M,,,";
                  
-  writeNMEAstr(QString(str3.str().c_str()));
-
-  QDateTime dateTime = QDateTime::currentDateTime().toUTC();
-  QString nmStr = "GPRMC," + dateTime.time().toString("hhmmss")
-                + ",A,0.00,S,0.00,E,0.00,0.00,"
-                + dateTime.date().toString("ddMMyy")
-                + ",,";
-  writeNMEAstr(nmStr);
+  writeNMEAstr(QString(strGGA.str().c_str()));
 
   return success;
Index: /trunk/BNC/bnctime.cpp
===================================================================
--- /trunk/BNC/bnctime.cpp	(revision 2565)
+++ /trunk/BNC/bnctime.cpp	(revision 2566)
@@ -113,4 +113,16 @@
     return this->_sec - time1._sec;
   }
+}
+
+// 
+//////////////////////////////////////////////////////////////////////////////
+void bncTime::civil_date (unsigned int& year, unsigned int& month,
+                          unsigned int& day) const {
+  double day_d;
+  long int yy, mm;
+  jmt(_mjd, yy, mm, day_d);
+  year  = yy;
+  month = mm;
+  day   = static_cast<unsigned int>(day_d);
 }
 
@@ -166,4 +178,19 @@
 }
 
+// 
+//////////////////////////////////////////////////////////////////////////////
+string bncTime::datestr(char sep) const {
+  unsigned int year, month, day;
+  civil_date(year,month,day);
+  ostringstream str;
+  str.setf(ios::fixed);
+  str << setfill('0');
+  str << setw(4)  << year;
+  if (sep) str << sep;
+  str << setw(2)  << month;
+  if (sep) str << sep;
+  str << setw(2)  << day;
+  return str.str();
+}
 
 // 
Index: /trunk/BNC/bnctime.h
===================================================================
--- /trunk/BNC/bnctime.h	(revision 2565)
+++ /trunk/BNC/bnctime.h	(revision 2566)
@@ -18,4 +18,6 @@
   unsigned int gpsw()   const;
   double       gpssec() const;
+  void         civil_date (unsigned int& year, unsigned int& month,
+                           unsigned int& day) const;
   void         civil_time (unsigned int& hour, unsigned int& min,
                            double& sec) const;
@@ -27,4 +29,5 @@
 
   std::string timestr(unsigned numdec = 3, char sep = ':') const;  
+  std::string datestr(char sep = '-') const;  
 
  private:
