Coder Social home page Coder Social logo

Comments (10)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
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

from as3corelib.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
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

from as3corelib.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
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

from as3corelib.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
BTW, I'd be happy to help :)

Original comment by wmdmark on 1 May 2007 at 3:39

from as3corelib.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
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 [email protected] on 4 Jun 2008 at 10:32

from as3corelib.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
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 [email protected] on 5 Jun 2008 at 12:58

from as3corelib.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
are there news about it?

Original comment by [email protected] on 18 Feb 2009 at 11:22

from as3corelib.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
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 [email protected] on 15 Jun 2009 at 3:46

from as3corelib.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Issue 94 has been merged into this issue.

Original comment by darron.schall on 3 Aug 2009 at 12:59

from as3corelib.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
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

from as3corelib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.