Open GoogleCodeExporter opened 9 years ago
Here is the RFC:
http://www.ietf.org/rfc/rfc4627.txt?number=4627
I cant find any mention of dates.
Here is a page from mozilla's thoughts on EcmaScript 4 and JSON:
http://developer.mozilla.org/es4/proposals/json_encoding_and_decoding.html
Specifically, it mentions:
--
*
Date.prototype.toJSONString()
Returns a String containing the representation of a date. A Date object is
serialized
as an ISO date string in double quotes.
--
So, I think it is very important that we follow whatever the "standard" is.
There are
already alternate implementations, which could result in incompatible versions
of JSON.
I will ping Douglas Crockford, and see if they have any definitive thoughts on
date
serialization in JSON.
Original comment by mikechambers
on 10 Jan 2007 at 4:51
The latest JSON.js file (from December 6, 2006), has support for Dates:
http://www.json.org/json.js
It uses ISO 8601
http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html
We have some Data format functions in DateUtils
http://as3corelib.googlecode.com/svn/trunk/src/com/adobe/utils/DateUtil.as
but unfortunately, dont have ISO 8601
Original comment by mikechambers
on 10 Jan 2007 at 5:07
Are there any work arounds for this? I'm needing to parse dates from a JSON
feed in
a project I'm working on. The date value comes in from the server as "new Date(-
59011459200000)"
Original comment by wmdmark
on 1 May 2007 at 3:38
BTW, I'd be happy to help :)
Original comment by wmdmark
on 1 May 2007 at 3:39
until you resolve this you add this to JSONEncoder.as when checking the object
o.
else if (o is Date)
{
s = "new Date(" + o.time.toString() + ")";
return s;
}
else // o is a class instance
Original comment by kenlar...@gmail.com
on 4 Jun 2008 at 10:32
It seems that a lot of implementations of JSON are using proprietary date
formats to
get around this issue. This kind of defeats the interoperability aim of JSON. I
would suggest that providing a default serializer/deserializer for dates with
the
ability to insert or use a different one would be useful. In other words,
provide an
interface like
SerializeDate(param:Date):String
IsDate(param:String):bool
DeserializeDate(param:String):Date
where the interface could be changed if the server side technology uses a
different
format.
Like wndmark, I'd be happy to help too.
Original comment by alan.dur...@citi.com
on 5 Jun 2008 at 12:58
are there news about it?
Original comment by mchiar...@gmail.com
on 18 Feb 2009 at 11:22
Dear all,
I was in need to decode JSON coming from a .NET web service and as3corelib was
the
only solution I found, and after finding out that it does not decode the date I
took
the JSON source files and put them in my own lib and modified the code to check
for
the date string MS sends as json "\/Date(...)\/" and returns a proper date
object.
if anyone is intrested in this let me know.
thanks
Original comment by nopl...@gmail.com
on 15 Jun 2009 at 3:46
Issue 94 has been merged into this issue.
Original comment by darron.schall
on 3 Aug 2009 at 12:59
Is any progress being made to this? It's been an issue for going on 3 years.
Original comment by gmariani405
on 21 Sep 2009 at 7:02
Original issue reported on code.google.com by
darron.schall
on 29 Dec 2006 at 8:44