views:

72

answers:

3

Am I correct in assuming that I have to MANUALLY convert Json-encoded date strings to date objects in my client code?

Coming from C#, I took for granted that this was happening automatically, but I guess that was .NET.

Is there a built in mechanism for getting native javascript types from a Json string (for dates, ints, etc.)?

Thanks.

+1  A: 

JSON does not have a standard date type. There are various libraries (including .NET) with incompatible extensions for representing it.

Matthew Flaschen
+1  A: 

see Stand-Alone JSON Serialization on msdn which gives doc on MS implementation

moi_meme
+1  A: 

The JSON spec does not define a date data type. That is left up to you.

See Section A.8: http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf

ChaosPandion