Forum Moderators: open
The following displays the time in UK format. I am trying to get it to display EASTERN time as speak. But someone else might know and post it saving me ;-)
<script language="javascript">
var theDate = new Date(document.lastModified);
var ukDate = theDate.toGMTString();
document.write("<i>Last updated "+ukDate+"<I>");
</script>
-George
<script language="javascript">
months = ['January', 'Febraury', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
var theDate = new Date(document.lastModified);
theDate.setTime((theDate.getTime()+(5000*60*60)) )
with (theDate) {
document.write("<i>Last updated "+getDate()+' '+months[getMonth()]+' '+getYear()+' '+getHours()+':'+getMinutes()+":"+getSeconds()+"</i>")
}
</script>
Let's know if there are any problems...
-George
I'm, first off, a newbie.
Lately I've been hand keying in the silly updates, and that code you just wrote, is so close to what I could use, that I'll ask if you might alter it (Gosh I hope you're patient and have a moment too) so that it says
Last updated: 1 June 2004
to match good old Eastern Standard Time,
without seconds?
Much thanks for reading this l'il post,
JudithEm
Sorry I missed your first post! Anyway...
The script with the removal of seconds is:
<script language="javascript">
months = ['January', 'Febraury', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
var theDate = new Date(document.lastModified);
theDate.setTime((theDate.getTime()+(5000*60*60)) )
with (theDate) {
document.write("<i>Last updated "+getDate()+' '+months[getMonth()]+' '+getYear()+' '+getHours()+':'+getMinutes()+"</i>")
}
</script>
And with just the date with no time attached it is:
<script language="javascript">
months = ['January', 'Febraury', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
var theDate = new Date(document.lastModified);
theDate.setTime((theDate.getTime()+(5000*60*60)) )
with (theDate) {
document.write("<i>Last updated "+getDate()+' '+months[getMonth()]+' '+getYear()+"</i>")
}
</script>
To help get eastern time I require the location of where your site is hosted! If it is hosted in the required time zone then you can remove most of the above script. I'll help you out once you have replied with the location.
-George