לא קראתי את כל הנושא אבל אם אתה צריך זמן ב JS פשוט תעשה ככה:
PHP קוד:
<a href="#" onClick="
var the_date = new Date();
var the_hour = the_date.getHours();
var the_minute = the_date.getMinutes();
var the_second = the_date.getSeconds();
var the_time = the_hour + ':' + the_minute + ':' + the_second;
alert('The time is now: ' + the_time);">time!</a>