Date literals

Brendan Eich brendan at mozilla.com
Thu Nov 20 06:54:16 PST 2008


On Nov 19, 2008, at 9:59 PM, David-Sarah Hopwood wrote:

> Michael Haufe wrote:
>> FWIW, VB.NET uses the following syntax for date literals #8/23/1970
>> 3:45:39AM#
>>
>> Would that not solve the parsing problem?
>
> It would, since # is not otherwise used. But I don't see the point:
> what is wrong with using 'new Date("...")'? Date literals would be
> vanishingly rare compared to other literals; there are very few cases
> where it is correct to use a hard-coded date in a program.

Exactly. FWIW, this is why date literals were considered a long time  
ago for ES4, and rejected.

http://wiki.ecmascript.org/doku.php?id=proposals:date_literal_syntax
http://wiki.ecmascript.org/doku.php?id=proposals:inactive&s=date+literals

/be



More information about the Es-discuss mailing list