Welcome to MSDN Blogs Sign in | Join | Help

Marcelo's WebLog

Improving the world one entity at a time
System.DateTime.Ticks vs JSON Date

This is a good one to keep an eye for. If you are using the ASP.NET AJAX conventions for formatting dates (with ADO.NET Data Services does), then remember that the value for a Date indicates the number of ticks (milliseconds) that have elapsed since midnight 01 January, 1970 UTC. You can find out more about how values are represented on this page.

This is different from the Ticks property of System.DateTime, which is a value measured in 100-nanosecond units called ticks, and a particular date is the number of ticks since 12:00 midnight, January 1, 0001 A.D. (C.E.) in the Gregorian calendar.

Same name, different units. Usually you won't care unless you're writing your own serialization/deserialization, but it's handy to know if you need to look at what's going through the wire.

 

Posted: Wednesday, March 05, 2008 2:33 PM by marcelolr

Comments

Marcelo's WebLog said:

I've talked about the Date type in the past , and since then I've come across a couple of gotchas that

# June 4, 2008 7:38 PM
New Comments to this post are disabled
Page view tracker