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.


Comments (2)

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

Skip to main content