I was trying to make this from a long long time , and with the help of a friend and a book at last achieved it.
Live clock is a dynamic clock and not a static clock as we have in header of default SMF 2.0 RC3. I was trying to make the clock in such a way that it should be using as minimum resources as possible .
As it's not my alone work so not making a package of it (might someone may move it to appropriate board if it is in wrong place).
So to make it just make these following edits (
make backup of the file before editing it).
open themes\default\index.template.php
Find:
echo '
<li>', $context['current_time'], '</li>
</ul>';Replace it with:
echo '
<li>',timeformat(time(),'%B, %d, %Y'), '
<li id="clock">Loading...</li>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function refrClock()
{
var d=new Date();
var s=d.getSeconds();
var m=d.getMinutes();
var h=d.getHours();
var am_pm;
if (s<10) {s="0" + s}
if (m<10) {m="0" + m}
if (h>12) {h-=12;am_pm = "pm"}
else {am_pm="am"}
if (h<10) {h="0" + h}
document.getElementById("clock").innerHTML=h + ":" + m + ":" + s + am_pm;
setTimeout("refrClock()",1000);
}
refrClock();
// ]]></script>
</li></ul>';Hope you guys will like this small piece of code

.
For live demo can visit freakygurus.com (
You need to login to see the clock)
Edit: Now the clock code is compatible with "W3C Markup Validation"