Date literals

Peter Michaux petermichaux at gmail.com
Wed Nov 19 21:51:07 PST 2008


On Wed, Nov 19, 2008 at 6:37 PM, Dean Edwards <dean at edwards.name> wrote:
> Peter Michaux wrote:
>>
>> All the data types in ES3 listed in section 15 have literals version
>> (e.g. {} for Object, [] for Array etc) except for Date. Is there any
>> reason that the Kona 15.9.1.15 "Date Time string format" could not be
>> a literal form for date objects?
>>
>> YYYY-MM-DDTHH:mm:ss.sssTZ
>>
>> The 'T' in the middle makes this identifiable as a date literal
>> similar to how the 'e' or 'E' of an exponential number literal works.
>>
>> It would be beneficial to have a date literal as then a JSON object
>> could have date literal values and still be parsed quickly with eval.
>>
>
> d = true ? T12:00;
>
> What does this mean?

The same as what it means now. There isn't any date literal business
in there at all. A date literal would have to be the whole thing

YYYY-MM-DDTHH:mm:ss.sssTZ

Peter


More information about the Es-discuss mailing list