bueno este es el scipt que me vino con el template.. pero tiene 1 hora adelantada a la hora que corresponde,.. se puede modificar?
</script>
<script type="text/javascript">
var weekdaystxt=["Sunday", "Monday", "Thuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
var monthtxt=["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]
function showLocalTime(container, servermode, offsetMinutes, displayversion){
if (!document.getElementById || !document.getElementById(container)) return
this.container=document.getElementById(container)
this.displayversion=displayversion
var servertimestring=(servermode=="server-php")? '<?php print date("F d, Y H:i:s", time())?>' : (servermode=="server-ssi")? '<!--#config timefmt="%B %d, %Y %H:%M:%S"--><!--#echo var="DATE_LOCAL" -->' : '<%= Now() %>'
this.localtime=this.serverdate=new Date(servertimestring)
this.localtime.setTime(this.serverdate.getTime()+offsetMinutes*60*1000) //add user offset to server time
this.updateTime()
this.updateContainer()
}
showLocalTime.prototype.updateTime=function(){
var thisobj=this
this.localtime.setSeconds(this.localtime.getSeconds()+1)
setTimeout(function(){thisobj.updateTime()}, 1000) //update time every second
}
showLocalTime.prototype.updateContainer=function(){
var thisobj=this
if (this.displayversion=="long")
this.container.innerHTML=this.localtime.toLocaleString()
else{
var hour=this.localtime.getHours()
var minutes=this.localtime.getMinutes()
var seconds=this.localtime.getSeconds()
var dayofweek=weekdaystxt[this.localtime.getDay()]
var month=monthtxt[this.localtime.getMonth()]
this.container.innerHTML=formatField(hour, 2)+":"+formatField(minutes)+":"+formatField(seconds)
}
setTimeout(function(){thisobj.updateContainer()}, 1000)
}
function formatField(num, isHour){
return (num<=9)? "0"+num : num
}
</script>