# How can I get an automatic "last updated" in my web page?



## Podman

I haev been designing a web page for my wife. I am far from a web designer but have been quite chuffed with the results so far. She has just asked if it would be possible for me to add into the bottom of the page a "Last updated" section so people know the site is contstantly being updated.

The site is css style sheet with normal HTML pages. Could anybody tell me what code I would need to enter into the html of each page to get a "Last updated" section please.

Any help would be greatly appreciated.

Thanks
Pod.


----------



## Sequal7

You can use javascript, place this where you want the text to display (NOTE: If you are using a webpage editing program like frontpage, dreamweaver or similar you will need to be in source or code view for inserting this to work)


Code:


[B]<script type="text/javascript">[/B]

<!--
var m = "This page was last updated: " + document.lastModified;
var p = m.length-8;
document.writeln("<center>");
document.write(m.substring(p, 0));
document.writeln("</center>");
 -->
</script>

You can chane the text displayed by changing "This page was last updated: " to your own statement and you can change *document.writeln("");​*to *document.writeln("<left>");* or *document.writeln("<right>");*. Just make sure to change the closing *document.writeln("*​*");* to the same /left or /right as the first alignment properties

Or, you could use built in code (insert > date > automatically update) in frontpage or dreamweaver etc so that when you re-open the page, it updates that field automatically.


----------



## Podman

Brilliant! Thanks very much, I am using Kompozer, I do have dreamweaver and frontpage but Kompozer seemed the easiest to get straight into using.


----------



## Sequal7

Komposer is very good and very easy to use, unfortunately it does not have an insert/auto date function so you would need to use the code I gave you in the previous post. (this can also be accomplished with PHP, ASP, PERL etc..)

NOTE: You can click the area you want the date to show on the page in html view, then click the code view and your mouse will be in the correct place, paste that code and it will show once you view the webpage.


----------



## MMJ

the script tag should look like [/php]

later on in the body:



HTML:




good read: http://www.quirksmode.org/js/lastmod.html


----------



## Podman

I am in the uk, how can I get it to show as dd/mm/yyyy rather than mm/dd/yyyy ?


----------



## MMJ

PHP:


----------

