This project is read-only.

Getting System Date Time on changing system date time in NmeaInterpreter date time change event

Dec 17, 2013 at 12:40 PM
Edited Dec 17, 2013 at 12:42 PM
On changing the system date time the date time change event is showing me system date time instead of the GPS time
Here is the sample code :

// Sample Code
private void nmeaInterpreter1_DateTimeChanged(object sender, DateTimeEventArgs e)
    {
        BeginInvoke(new MethodInvoker(delegate
        {
            string  time = e.DateTime.ToShortDateString()+ " " + e.DateTime.ToLongTimeString();

        }));
    }
//End


Please help!!!!
Dec 17, 2013 at 8:26 PM
I have not used this nmeaInterpreter, but in my experience, the Date/Time classes translate into the local system time zone. If you want to see it in GMT/UTC as reported by the GPS, try:

e.DateTime.ToUniversalTime().ToLongTimeString()
Dec 18, 2013 at 5:19 AM
actually its not about the time zone. Its about the date time value. Let me make it more clear. Today is 18 Dec 2013 now I connected a GPS receiver and start my program. The date time I will get through nmeaInterpreter is the same 18 Dec 2013 but if I change the system date to for eg: 4 Nov 2013 then the value which I am getting is 4 Nov 2013 and on date time change event of nmeainterpreter the value will keep switching on 4 Nov 2013 and 18 Dec 2013.

That is the problem.