I'm using .NET to generate a JSON file that has many Dates in it.
For compression, I want to store them as milliseconds since Jan 1, 1970 and not strings, then convert them to Javascript Dates. But .Net's idea of milliseconds since 1970-01-01 don't match Javascript:
Javascript:
Date.parse("2012-05-15T13:57:57.0000000+00:00")
1337090277000
VB.Net:
Date.Parse("2012-05-15T13:57:57.0000000+00:00").Subtract(New Date(1970,1,1)).TotalMilliseconds
1337101077000.0
The difference is 10800 seconds. The difference at 1970-01-01 is 0 and changes over time.
Is there a way to compute Javascript's idea of milliseconds-since-epoch from within .Net?