<script type="text/javascript">
// Current Server Time script (SSI or PHP)- By JavaScriptKit.com (http://www.javascriptkit.com)
// For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/
// This notice must stay intact for use.
//Depending on whether your page supports SSI (.shtml) or PHP (.php), UNCOMMENT the line below your page supports and COMMENT the one it does not:
//Default is that SSI method is uncommented, and PHP is commented:
var currenttime = '<!--#config timefmt="%B %d, %Y %H:%M:%S"--><!--#echo var="DATE_LOCAL" -->' //SSI method of getting server date
//var currenttime = '<? print date("F d, Y H:i:s", time())?>' //PHP method of getting server date
///////////Stop editting here/////////////////////////////////
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
var serverdate=new Date(currenttime)
function padlength(what){
var output=(what.toString().length==1)? "0"+what : what
return output
}
function displaytime(){
serverdate.setSeconds(serverdate.getSeconds()+1)
var datestring=montharray[serverdate.getMonth()]+" "+padlength(serverdate.getDate())+", "+serverdate.getFullYear()
var timestring=padlength(serverdate.getHours())+":"+padlength(serverdate.getMinutes())+":"+padlength(serverdate.getSeconds())
document.getElementById("servertime").innerHTML=datestring+" "+timestring
}
window.onload=function(){
setInterval("displaytime()", 1000)
}
</script>
<p><b>Current Server Time:</b> <span id="servertime"></span></p>
<p style="font: normal 11px Arial">This free script provided by<br />
<a href="http://www.javascriptkit.com">JavaScript Kit</a></p>
<script language=Javascript>
function clock() {
var now = new Date();
var y = now.getYear();
var mybrowser=navigator.userAgent;
if(mybrowser.indexOf('MSIE')>0){
var years = y+543;
}
if(mybrowser.indexOf('Firefox')>0){
var years = y+1900+543;
}
if(mybrowser.indexOf('Presto')>0){
var years = y+1900+543;
}
if(mybrowser.indexOf('Chrome')>0){
var years = y+1900+543;
}
var days = new Array("วันอาทิตย์ ที่","วันจันทร์ ที่","วันอังคาร ที่"," วันพุธ ที่","วันพฤหัสบดี ที่"," วันศุกร์ ที่"," วันเสาร์ ที่")
var month = new Array("มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤษจิกายน","ธันวาคม")
var year= new Array("ชวด","ฉลู","ขาล","เถาะ","มะโรง","มะเส็ง","มะเมีย","มะแม","วอก","ระกา","จอ","กุล")
var months = month[now.getMonth()];
var day = days[now.getDay()];
var date = now.getDate();
var hour2 = "<?=date('H');?>";
var minutes2 = "<?=date('i');?>";
var seconds2 = "<?=date('s');?>";
var hour = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
if (minutes2<10){
minutes2 = "0"+minutes;
}
if (seconds2<10){
seconds2 = "0"+seconds;
}
var result = day + " " + date + " เดือน" + months + " " + years + " เวลา " + hour2 + ":" + minutes2 + ":" + seconds2;
return result;
}
function timeupdate(){
document.timef.timebox.value=clock()
setTimeout("timeupdate()",100)
}
</script>