...

View Full Version : modification of time format



qwertyuiop
04-17-2005, 12:33 AM
Hello,
This should be simple:
How do i modify the javascript to display the time in the same format the the "echo date" part? (php g:i:s A)


<html>
<head>
<title>Dynamic Time</title>
<script type="text/javascript">
<!--
servertime = <?= time() ?>;
usertime = new Date();
useroffset = servertime - usertime;

function showtime(){
d=new Date(Number(new Date())+useroffset);
document.getElementById("dyntime").innerHTML=d;
}
//-->
</script>
</head>

<body onload="setInterval('showtime()',250)">

<span id="dyntime">
<?
echo date('g:i:s A <\a\c\r\o\n\y\m \t\i\t\le=\"\P\a\c\i\f\i\c \S\t\a\n\d\a\r\d \T\i\m\e (-0800)\">[\P\S\T]</\a\c\r\o\n\y\m>', time() - (7200));
?>
</span>

</body>
</html>

I found this script here (http://66.102.7.104/search?q=cache:PohUWwYuX28J:www.php-resources.org/help/article-php.notes-78950.php+%22dynamic+server+time%22&hl=en) and modified it a little bit.

Thanks

[edit] problem solved! (i used a different script) thanks if you tried to help



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum