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

DateTime.UtcNow bug

ntp DateTime

  • Please log in to reply
No replies to this topic

#1 Jeffa

Jeffa

    Member

  • Members
  • PipPip
  • 14 posts
  • LocationCurrently Los Angeles

Posted 20 February 2013 - 02:13 AM

For a couple days now I've been reading about ISO 8601 Date and Time representations. This Wikipedia article has some good information. 

 

As of about version 4 .net has standardized on ISO 8601 for representation of DateTime when serializing. See this article by Scott Hanselman

 

In an application I have code that writes DateTime.UtcNow which is apparently creating an incorrectly formatted serialization of DateTime. The only allowable alpha Timezone is 'Z' for zulu. Others are expressed as numeric offsets.

 

Note these two Json serializations. The first from a .net windows phone application (correct), the second from my ndp2 (incorrect) project. Both reporting to Azure.

 

 [{"id":1,"DataLoggerName":"Ben Walkin","Time":"2013-02-19T18:39:51.733Z",[{"id":1,"DataLoggerName":"JHANetDuino","Time":"2013-02-19T16:46:55.205K",

I hope to work around this problem by learning how to set a Timezone in .netmf. However using DateTime.UtcNow should not reflect the local time. Correct?

 

I documented some of my travails in this stackoverflow question. And earlier in these forums in this article.

 

 

 

 

 

 


---
KF7CRU @jhalbrecht
Work: www.iea-software.com
Tmi: www.rodaw.com, tumblr.rodaw.com





Also tagged with one or more of these keywords: ntp, DateTime

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.