Main Site Documentation

Setting RTC from GPS


#1

I have a UTC time from a GPS string that I want to use to set the RTC on the Domino.

But, I want to be able to read the time as my local time instead of the UTC. What is the best way to do this?


#2

Our GPS driver already returns a DateTime object
http://www.tinyclr.com/downloads/Extension/Broch_GPSExtension.pdf

From there, you can set your system time like this
Microsoft.SPOT.Hardware.Utility.SetLocalTime(currDateTime);

Also, see this post
http://www.tinyclr.com/forum/2/104/

You can get item from anywhere, GPS, RTC, timeserver and then set the system clock


#3

I am using Utility.SetLocalTime(), but how do I convert UTC to my local time for the offset between UTC and EST?


#4

Hi Tony,

i just came across this statement that might help you out here?

How can I set the “correct” TimeZone?
Using the Microsoft.SPOT.ExtendedTimeZone.SetTimeZone(TimeZoneInfo) method.

(from http://informatix.miloush.net/microframework/FAQ.aspx?Globalization%2FDate+%26+Time)

hope it helps!


#5

Thanks brett. We can always some some help from users like you;)


#6

Brett,

The ExtendedTimeZone class is NOT in Microsoft.SPOT.
I am using .NET MF 4.0, is that something that was in a previous version?

I did a search on that class in the object browser and it turned up empty.

Any suggestions?


#7

Timezone is supported through http://msdn.microsoft.com/en-us/library/ee436176.aspx
That is Microsoft.SPOT.Time.TimeService.SetTimeZoneOffset(-5*60);//-5 hours