Search
Syndication
Sponsors

An updating clock

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)


This is a clock that updates, it actually merely does a refresh every 1 second, this is assuming that you create a file called clock.php and copy the examnple below into it

<HTML>
<HEAD>
<TITLE></TITLE>
<META HTTP-EQUIV=”refresh” CONTENT=1″; URL=clock.php”>
</HEAD>
<BODY>
<?php
Print “The time is: “;
$hour = date(’H'); //hours.
$minute = date(’i'); //minutes.
$seconds = date(’s’); //seconds
$time = “$hour : $minute : $seconds”; //put them together
Print $time
?>
</BODY>
</HTML>

Related posts:

  1. Convert 24 hour time to 12 hour time This example converts 24 hour formatted date to 12 hour...
  2. Ajax and PHP Stock Quote example This isĀ  a new source code section so we thought...
  3. Get Dow Jones stock market data This example retrieves the latest Dow Jones data from Yahoo...

Related posts brought to you by Yet Another Related Posts Plugin.



Tags: ,

Leave a Reply