Safari Javascript bug

I have found that Safari cannot handle Javascript Date.parse() correctly which is a major problem for me. I am generating a GMT string in Perl, passing it to a cookie and then using Date.parse(gmtstring) to turn it into milliseconds so that I can do calculations. Every other browser returns the milliseconds correctly but Safari returns NaN. Does anybody have a workaround?

G5 Mac OS X (10.4.8)

Posted on Feb 2, 2007 4:27 AM

Reply
5 replies

Feb 2, 2007 7:07 PM in response to dobrojoe

apparently safari won't parse that particular date format; i think the "GMT" needs to follow the time.

you'll have to use a different format, e.g.:

use POSIX;
my $expDate = strftime "%a %b %e %Y %H:%M:%S GMT", gmtime;


or use javascript to reformat the string.

of course you could also request that safari support native gmtime() format. i think bug 3366 is the one you want.

iBook g4 OS X.4.x

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Safari Javascript bug

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.