date and time in dreamweaver

  mco 12:13 20 May 06
Locked

Bear with me; this is only my second day on dreamweaver and I've already posted another thread lower down...I've inserted 'the date' on several pages, as offered by dreamweaver,but when I've uploaded and viewed online it doesn't tell the correct time - in fact, they all have different times presumably when I modified the page. Am I right to assume it is an actual clock? Or is it just a 'date and time last modified' insertion? (In which case I'll find my own)

  RicScott 15:33 20 May 06

Usually in web design, the date and time is actually produced by the server..try this javascript code instead.

Put this bit in the <head> section </head>

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">

var d=new Date();
var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
//Ensure correct for language. English is "January 1, 2004"
var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();

</SCRIPT>

And put this bit where you want the date and time to show up on the page:

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
document.write(TODAY); </SCRIPT>

Hope this helps...
Ric

  mco 00:43 21 May 06

I've got rid of the original date and put a real clock in and it now works fine.

This thread is now locked and can not be replied to.

Amazon Fire HD 8 review: A brilliant combination of function and value – with one massive caveat

1995-2015: How technology has changed the world in 20 years

How to create an introvert-friendly workplace

Apple Watch 2 review | Apple Watch Series 2 review: New Apple Watch is faster, brighter, water-resit…