Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

new Date '1JAN2008' or '2008JAN1'

8 views
Skip to first unread message

biju

unread,
Jul 31, 2008, 8:12:13 PM7/31/08
to
[new Date("1JAN2008"), new Date("2008JAN1")]

IE gives == >
Tue Jan 1 00:00:00 UTC-0400 2008,Tue Jan 1 00:00:00 UTC-0400 2008

Firefox Trunk gives == >
Invalid Date,Invalid Date

Is it a bug?


PS:
[new Date('1 JAN2008'), new Date('2008 JAN1')]; works fine on
firefox

Martin Honnen

unread,
Aug 1, 2008, 1:21:00 PM8/1/08
to
biju wrote:
> [new Date("1JAN2008"), new Date("2008JAN1")]
>
> IE gives == >
> Tue Jan 1 00:00:00 UTC-0400 2008,Tue Jan 1 00:00:00 UTC-0400 2008
>
> Firefox Trunk gives == >
> Invalid Date,Invalid Date
>
> Is it a bug?

I don't think the ECMAScript specification is detailed enough to tell
which formats should be accepted by new Date("stringwithdate"). It
delegates the parsing to the parse method but its specification then
does not tell much about the formats to be accepted or rejected.


--

Martin Honnen
http://JavaScript.FAQTs.com/

biju

unread,
Aug 2, 2008, 11:36:42 PM8/2/08
to
On Aug 1, 1:21 pm, Martin Honnen <mahotr...@yahoo.de> wrote:
> biju wrote:

thanks...

0 new messages