Re: Mac vs PC Javascript

by Brian V Bonini <b-bonini(at)cox.net>

 Date:  12 Jun 2003 09:49:07 -0400
 To:  Wisca <andrew(at)wisca.co.uk>
 Cc:  Brigitte Schneider <wbsps(at)yahoo.com>, HWG Techniques <hwg-techniques(at)hwg.org>
 References:  hwg
  todo: View Thread, Original
On Thu, 2003-06-12 at 06:31, Wisca wrote:
> I gave up using the date in JavaScripts because I found that every browser I tried it on had the date in a different form - even different versions of Internet Exploder.
> 
> That is a particular problem because it is almost impossible to have more than one version of IE per computer - so on one occasion what worked on IE 5, IE5.5, IE6, NN4.x, didn't work on IE4, and I had no easy way to find out why. The reason that I ceased using the date, though, was the uncertainty about new browser releases, that might completely break it.
> 
> In principle you could probably write something to parse the date string super intelligently, but I couldn't see any way that was not absurdly complex.
> 
> Andrew Armstrong
> 

How about using a C program?  Just compile this on your server.
No browser dependency there.

Untested:

#include <time.h>
#include <stdio.h>
main()
{
puts ("Content-type: text\\html\n");
puts (ctime(time() + (12*60*60)));
}
------------------------------------------

Execute the program with SSI:
<!--#exec cmd="melbtime.cgi" -->

Or is you can exec SSI try this:
<!--#exec cmd="/bin/date" -->

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA