mikechambers / as3corelib

An ActionScript 3 Library that contains a number of classes and utilities for working with ActionScript? 3. These include classes for MD5 and SHA 1 hashing, Image encoders, and JSON serialization as well as general String, Number and Date APIs.
1.5k stars 451 forks source link

parseW3CTDF() and ms #165

Open Tetranos opened 13 years ago

Tetranos commented 13 years ago

The parseW3CDTF() method gives a bad result with the following string : "2011-04-11T22:03:44.578125Z".

As mentionned by the W3C (http://www.w3.org/TR/NOTE-datetime), the number after the "." is a decimal fraction of a second and not milliseconds.

The parseW3CDTF() method interprets this number as milliseconds and : 578125 ms = 578 s + 125 ms = 9 min + 578 s + 125 ms

It should be interpreted like this : 0.578125 s = 578 ms + 0.000125 s