Main Site Documentation

What's new in RTC Functions?


#1

I am still trying to figure out the RTC and TimeZone functionality in .NET MF.

I have the UTC from GPS and want to set the RTC for my local time based on the offset for UTC.

Is there any sample code which shows this?
I have looked around, but the new class in 4.0 seems lacking somehow. I mean it should just be a couple lines of code, but what code???


#2

Not sure why you started new thread with same question! We already covered that, we gave all suggestions we have. Look again if you like http://www.tinyclr.com/forum/1/109/

If answers are still not satisfying then please try the Microsoft forum if you like.(Which we already suggested as well!)

http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?dg=microsoft.public.dotnet.framework.microframework


#3

Because none of those worked…

Or, MS says they don’t support TimeZone in MF at least that’s what I found.

I could not find a single example that worked for .NET 4.0.

But you mention there is support for RTC in the new firmware version. What is new?


#4

See RealTimeClock class. It is needed to set and clear the hardware clock. This has nothing to do with NETMF software clock or time zones…etc.

If Microsoft say they do not support time zone then that is the end of this! Where did you get this answer that they do not support timezones?


#5

Timezone is supported through http://msdn.microsoft.com/en-us/library/ee436176.aspx
That is Microsoft.SPOT.Time.TimeService.SetTimeZoneOffset(-5*60);//-5 hours
You just had to look in documentation to see it :wink:

Please try to search documentation better in future.

Also, where did Microsoft say they do not support timezone?
You said "MS says they don’t support TimeZone in MF at least that’s what I found"
False info can really get everyone confused so please make sure you verify things before posting.


#6

Try your code below:

TimeService.SetTimeZoneOffset(-5*60);//-5 hours

I get a System.NotSupportedException error when it hits that line of code.

Not sure why it’s available in Microsoft.SPOT.Time if it generates that error message???


#7

Strange! Let me check and will get back to you.


#8

We found why it is throwing the exception. It is fixed in next release.
Thank you for your cooperation.


#9

Is it the next release of .NET MF or your SDK?

Thanks,
Tony


#10

Our SDK, in about 2 weeks.