﻿
//GMT Clock
function gmtClock()
{ 
    time = new Date()
    gmtMS = time.getTime() + (time.getTimezoneOffset() * 60000)
    gmtTime =  new Date(gmtMS)
    hour = gmtTime.getHours()
    hour= hour + 1 //Changes made on 25/05/07            //change from +1 to +2 on dated:20 June 2007
    minute = gmtTime.getMinutes()
    second = gmtTime.getSeconds()
    temp = "" + ((hour < 10) ? "0" : "") + hour
    temp += ((minute < 10) ? ":0" : ":") + minute
    
    document.getElementById("clock").firstChild.nodeValue = temp+" CET";
    setTimeout("gmtClock()",1000)
}  
//End of GMT Clock


//Current time according to client system 
function init ( )
{
    timeDisplay = document.createTextNode ( "" );
    document.getElementById("clock").appendChild ( timeDisplay );
}

function updateClock ( )
{
    var currentTime = new Date ( );

    var currentHours = currentTime.getHours ( );
    var currentMinutes = currentTime.getMinutes ( );
    var currentSeconds = currentTime.getSeconds ( );

    // Pad the minutes and seconds with leading zeros, if required
    currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
    currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;

    // Choose either "AM" or "PM" as appropriate
    var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";

    // Convert the hours component to 12-hour format if needed
    currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;

    // Convert an hours component of "0" to "12"
    currentHours = ( currentHours == 0 ) ? 12 : currentHours;

    // Compose the string for display
    //var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + timeOfDay;
    var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds 

    // Update the time display
    document.getElementById("clock").firstChild.nodeValue = currentTimeString;
}



            