Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

TimeService.SetTimeZoneOffset now throwing NotSupportedException

timezone

  • Please log in to reply
2 replies to this topic

#1 Tom

Tom

    New Member

  • Members
  • Pip
  • 7 posts

Posted 19 August 2015 - 06:20 AM

Hi Guys,

 

I'm porting some applications over to the N3-Wifi, from the N2-Plus. I made use of the TimeService.SetTimeZoneOffset method to provide a timezone offset so that DateTime.UtcNow supplied the correct value. 

 

Those methods are now throwing a NotSupportedException. 

 

Is this call, and the related ones (SetUtcTime) going to be reinstated, or are they gone for good? 

 

If they're gone, whats the recommended approach to getting DateTime.UtcNow != DateTime.Now for everyone not in GMT? 

 

Cheers!



#2 TechnoGuy

TechnoGuy

    Advanced Member

  • Members
  • PipPipPip
  • 51 posts
  • LocationCanada

Posted 12 October 2015 - 01:00 PM

I too have code that I wrote for a Netduino Plus 2 that uses the TimeService class from the Microsoft.SPOT.Time assembly.  It goes out to an NTP time server and sets my Netduino's time automatically.

 

It works perfectly on my Netduino Plus 2.  When I run the same exact code on my Netduino 3 WiFi, I get a System.NotSupportedException, just like the original poster.

 

In my case it's when I load new TimeService settings (before the call to SetTimeZoneOffset), basically like this:

        TimeServiceSettings settings = new TimeServiceSettings();

        settings.ForceSyncAtWakeUp = true;
        settings.RefreshTime = 1800;    // Seconds
        settings.PrimaryServer = GetTimeServerAddress();

        TimeService.Settings = settings;            // EXCEPTION THROWN HERE
        TimeService.SetTimeZoneOffset(-360);        // Mountain Time

I am wondering if this has something to do with the implementation of the new IP stack on the Netduino 3?

I still have the old IP stack on my Netduino Plus 2 (I have NOT installed Netduino.IP).

 

Chris - this is a deal breaker for me.


- Ian

 

My Current Dev Boards:

  • 3 x Netduino Plus 2
  • 1 x Netduino 3 WiFi

#3 TechnoGuy

TechnoGuy

    Advanced Member

  • Members
  • PipPipPip
  • 51 posts
  • LocationCanada

Posted 14 October 2015 - 11:54 PM

Paolo Patierno has some interesting comments on this as well.  Please see his January 2015 article:

TimeService and .Net Micro Framework : the importance of date/time in the IoT

http://www.embedded1...time-in-the-iot

 

Chris - I am hoping you could please take a look at this problem & let us know what's up.  Thank you.


- Ian

 

My Current Dev Boards:

  • 3 x Netduino Plus 2
  • 1 x Netduino 3 WiFi




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.