Re: json date time objects
- Basically Dates are encoded as ISO 8601 strings by default (but this
can be customized), and a "hook" or callback function allows you to
deserialize them (or any other node for that matter) during parseJSON.
Functions are strictly not allowed in JSON as they are potentially
meaningless to other languages as well as a potential security risks.
There has also be some debates about Dates a couple of times before,
which resulted in the above solution. Check out some of these threads
for more info:
--- In email@example.com, Mert Sakarya <mertsakarya@...> wrote:
> You can write any date data as a string in a JSON document, then if
language's, DateTime functions to convert.
> To: json@...: prasannarupan@...: Thu, 12 Jul 2007 05:10:15
+0000Subject: [json] Re: json date time objects
> Does this mean that Date objects created using new Date() can be
directly mapped to Java Objects? Can the date object created this way
be formatted into different date time formats?please let me
knowThanks--- In firstname.lastname@example.org, "brucehub33"
<bruce.hubbard33@> wrote:>> --- In email@example.com, "rkmr.em@"
<rkmr.em@> wrote:> >> > Does JSON support a datetime object?> > > >
thanks> > > > > > [Non-text portions of this message have been
removed]> >> you can put whole functions in a json object if you
like. So in short > yes just make a new Date() object within you JSON
> Don't get caught with egg on your face. Play Chicktionary!
> [Non-text portions of this message have been removed]