What's the best way to pass a .NET System.DateTime using JSON so that javascript from the jQuery side can construct a javascript Date object?
1 answer
Using milliseconds, I believe this is your best bet as it leads to a simple conversion. One issue that you want to be careful about is that clocks can be in different time zones, so you might need to be aware of this and perhaps send the time in a known standard time zone.
If you just need to display, you can send the date as a string, but that makes it difficult to navigate to change the time zone.
The best solution will depend on how it is used and your needs.
+3
source to share