If the site is hosted on an Apache [httpd.apache.org] server you could use mod_include [httpd.apache.org].
<!--#echo var="DATE_LOCAL" -->
The above code will insert the local date.
Of course you could use any server side scripting language as well.
[edited by: andreasfriedrich at 2:58 pm (utc) on Feb. 21, 2003]
var date = new Date();
var d = date.getDate();
var day = (d < 10)? '0' + d : d;
var m = date.getMonth() + 1;
var month = (m < 10)? '0' + m : m;
var yy = date.getYear();
var year = (yy < 1000)? yy + 1900 : yy;
document.write(day + "/" + month + "/" + year);
this is a useful one also.
var months=new Array(13);
var time=new Date();
var lmonth=months[time.getMonth() + 1];
if (year < 2000)
year = year + 1900;
document.write("<right>" + lmonth + " ");
document.write(date + ", " + year + "</right>");
Thanks for that, it is great help but unfortunately I dont know where to put the scripts!
Ive tried them both a few places and I usually get script error or the date just doesnt change!
Put the scripts wherever you were normally putting the date on your page. When copying and pasting, make sure you don't alter anything in the scripts above.
The only important thing really is that the script is between the <body> tags of your page. If you are using a WYSIWYG editor like Frontpage you will need to look at the source code.
If this doesn't make sense, sticky me or post and I will talk you through it.
BTW if the date is vital to your form Iīd go with a server side solution.
I'm going to point you back to this long thread, as there was some code examples included there:
Some of the solutions in the above thread are server side IIRC.
If your comment was addressed to me. You're right some of the solutions are server-side. I never meant to imply they weren't. But since most of the suggestions seemed to involve JS I thought it would be a good idea to point out one of the downsides of JS. :)
It is a good idea GaryK, but one that does not seem to be very popular in this thread :o.