tl24 / jsonexserializer

Automatically exported from code.google.com/p/jsonexserializer
1 stars 1 forks source link

DateTime Deserializing Produces a String #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I have a hashtable which is keyed via a string.  In the value of the
hashtable I have an array list which contains an integer and a datetime.
2. Serialize this object to JSON.  The output for the datetime is in the
ISO format of 1995-04-30T00:00:00.0000000.
3. When de-serializing this object the parser reads the datetime as a
"quotedString" and will return a string value.  

What is the expected output? What do you see instead?
The expected output should be of type DateTime however the Deserialize
method will return a string instead.

What version of the product are you using? On what operating system?
Product version: 30.25.205. Operating System: Windows XP Pro SP3.

Please provide any additional information below.

Original issue reported on code.google.com by KyleLeMa...@gmail.com on 5 Aug 2009 at 2:36

GoogleCodeExporter commented 9 years ago
Since you are deserializing to an ArrayList there is no type information to 
tell it 
that it's a date so it uses the default which would be a string for a quoted 
value.  
How complicated is the data structure could you deserialize to a strongly typed 
class?

Original comment by elliott....@gmail.com on 5 Aug 2009 at 3:33

GoogleCodeExporter commented 9 years ago
I don't believe I could deserialize to a strongly typed class because the 
information that I am storing in the hash table may contain anything. 
(integers, 
strings, dates)  There is no guerentee that there is a date in the arraylist.  
It is 
basically key values for a datatable.  Thanks for the help.

Original comment by KyleLeMa...@gmail.com on 5 Aug 2009 at 5:34

GoogleCodeExporter commented 9 years ago

Original comment by elliott....@gmail.com on 26 Sep 2009 at 2:19