Skip to content

Commit

Permalink
fix for gps date
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12867 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Feb 3, 2010
1 parent 95190d9 commit ca86c17
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/core/gps/qgsnmeaconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
}
}
}

Expand Down

0 comments on commit ca86c17

Please sign in to comment.