var gmt_date_str = 'August 28, 2008 13:31:17' /* Live Date Script- © Dynamic Drive (www.dynamicdrive.com) For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use, visit http://www.dynamicdrive.com Modifications by Avatar Web Promotions http://www.avatar.co.nz/ */ var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December"); var init_date = new Date(); // You have to be careful how you set the initial date as browsers differ in how they handle their timezone settings. // Attempting to use setTime() with a unix timestamp will work only with Firefox. var ci_date = new Date(gmt_date_str); ci_date.setTime(ci_date.getTime() - 36000000); // GMT - 10 hours. Luckily they don't observe daylight savings or my head would really be in a spin :) var offset = ci_date.getTime() - init_date.getTime(); function getthedate() { var mydate=new Date(); mydate.setTime(mydate.getTime() + offset); var day=mydate.getDay(); var month=mydate.getMonth(); var daym=mydate.getDate(); var hours=mydate.getHours(); var minutes=mydate.getMinutes(); var dn="AM"; if (hours>=12) dn="PM"; if (hours>12) { hours=hours-12; } if (hours==0) hours=12; if (minutes<=9) minutes="0"+minutes; var cdate=dayarray[day]+" "+daym+" "+montharray[month]+" "+hours+":"+minutes+" "+dn; if (document.all) document.all.clock.innerHTML=cdate; else if (document.getElementById) document.getElementById("clock").innerHTML=cdate; else document.write(cdate); } if (!document.all&&!document.getElementById) getthedate(); function start_clock(){ if (document.all||document.getElementById) setInterval("getthedate()",1000); }