Skip to content
Permalink
Browse files

fix for gps date

git-svn-id: http://svn.osgeo.org/qgis/trunk@12867 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Feb 3, 2010
1 parent 95190d9 commit ca86c17448db45d202f245c90f9c88e68f05643a
Showing with 11 additions and 4 deletions.
  1. +11 −4 src/core/gps/qgsnmeaconnection.cpp
@@ -180,11 +180,18 @@ void QgsNMEAConnection::processRMCSentence( const char* data, int len )
mLastGPSInformation.direction = result.direction;

//date and time
QDate date( result.utc.year, result.utc.day, result.utc.sec );
QDate date( result.utc.year, result.utc.mon + 1, result.utc.day );
QTime time( result.utc.hour, result.utc.min, result.utc.sec );
mLastGPSInformation.utcDateTime.setTimeSpec( Qt::UTC );
mLastGPSInformation.utcDateTime.setDate( date );
mLastGPSInformation.utcDateTime.setTime( time );
if ( date.isValid() && time.isValid() )
{
mLastGPSInformation.utcDateTime.setTimeSpec( Qt::UTC );
mLastGPSInformation.utcDateTime.setDate( date );
mLastGPSInformation.utcDateTime.setTime( time );
QgsDebugMsg( "utc time:" );
QgsDebugMsg( mLastGPSInformation.utcDateTime.toString() );
QgsDebugMsg( "local time:" );
QgsDebugMsg( mLastGPSInformation.utcDateTime.toLocalTime().toString() );
}
}
}

0 comments on commit ca86c17

Please sign in to comment.
You can’t perform that action at this time.