how to display system time in php
Moderator: General Moderators
how to display system time in php
hi guys i want to display system time which is running time on system i mean to say when time is change in system clock it will automatically change on my page no need to to refresh the page
so kindly help me in this regards if any one know
thanks in advance waiting for ur replies .
so kindly help me in this regards if any one know
thanks in advance waiting for ur replies .
-
DacehallReggae
- Forum Newbie
- Posts: 1
- Joined: Tue Nov 10, 2009 2:06 am
Re: how to display system time in php
hello all have a nice day
Re: how to display system time in php
i have asked a question man if u know kindly tell me
Re: how to display system time in php
Use like this
Code: Select all
<?php
echo date("F j, Y, g:i a");
?>
Re: how to display system time in php
thanks for ur reply i have used this code but it show current time by refreshing the page if i am at one page for half hour than this time is not the system time so i want to the code which automatically refresh the time with out refreshing whole page
waiting for ur replies
waiting for ur replies
Re: how to display system time in php
so kindly send me the code in java script for that i have no more idea about that
waiting for reply
waiting for reply
Re: how to display system time in php
You will need to use a Javascript Timeout
This bit of Javascript will reload your page every second
This bit of Javascript will reload your page every second
Code: Select all
window.setTimeout(function()
{
window.location.reload();
}, 1000);
Re: how to display system time in php
but i don't want to reload whole page after each second i want to refresh only time after each second
Re: how to display system time in php
Try this
Code: Select all
<html>
<head>
<title>Timer</title>
<script language="javascript">
function setTimer()
{
var d = new Date();
var t_hour = d.getHours(); // Returns hours
var t_min = d.getMinutes(); // Returns minutes
var t_sec = d.getSeconds(); // Returns seocnds
var curtime = t_hour +":"+ t_min +":"+ t_sec;
var obj = document.getElementById('timer');
obj.innerHTML = curtime;
}
setInterval('setTimer()',1000);
</script>
</head>
<body>
<div id="timer" style="font:Verdana, Arial, Helvetica, sans-serif; font-weight:bolder;"></div>
</body>
</html>
Re: how to display system time in php
thanks dear for ur cooperation exactly same thing i need now just kindly tell me i want to display date and time in this format so what changes i need
Wednesday, November 11, 2009 3:58:49 AM
waiting for ur reply
Wednesday, November 11, 2009 3:58:49 AM
waiting for ur reply
Re: how to display system time in php
Thanks to all of u guys i resolved my problem thx