[Webkit-unassigned] [Bug 29063] New: JSON.stringify(Date) losts the milliseconds information

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 8 18:37:36 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=29063

           Summary: JSON.stringify(Date) losts the milliseconds
                    information
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh Intel
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P3
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: shumpei.shiraishi at gmail.com


Created an attachment (id=39241)
 --> (https://bugs.webkit.org/attachment.cgi?id=39241)
Test case for this bug.

I tried to use the JSON.stringify() for Date object on Safari4 and
WebKit nightly build(48096), so I got result as follows.

> JSON.stringify(new Date());
> 2009-09-07T04:49:43Z

This result seems that milliseconds information of date is lost.
For some applications, millis info is important and this behavior may
be problem.

And in the ECMAScript 5th specification, Date.toISOString() (this
function is called from Date.prototype.toJSON()) is defined as:

...Date Time string format (15.9.1.15). *All fields are present* in
the string...

So, I think the Webkit's behavior should be treated as a bug, isn't it?

P.S.
Current implementations' status is as follows (tested by attached test case):

Firefox3.5: keep milliseconds
Webkit: lost milliseconds
Opera10: not yet implemented
IE8: lost milliseconds

Mmm... IE8's behavior is same as Webkit.
Is current behavior collect? Is JSON.stringify() useless for apps which want to
treat the information of milliseconds?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list