Support Forums

Full Version: my basic clock in php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Demo:
http://bmx3r.com/clock/clock.php

Images:
http://bmx3r.com/clock/
you have to grab images or use your own numbers.

Php code:

PHP Code:
$hours date("h");
$minutes date("i");
$seconds date("s");
$ampm date("a");
$hours1substr("$hours"01);
$hours2 substr("$hours"11);
$minutes1 substr("$minutes"01);
$minutes2 substr("$minutes"11);
$seconds1 substr("$seconds"01);
$seconds2 substr("$seconds"11);
/* AM or PM */
if($ampm == "am")
{
$time_ampm "am.gif";
}
else
{
$time_ampm "pm.gif";
}

/* hours*/
print "<img src=\"$hours1.gif\"><img src=\"$hours2.gif\"><img src=\"colon.gif\">";

/* minutes */
print "<img src=\"$minutes1.gif\"><img src=\"$minutes2.gif\"><img src=\"colon.gif\">";

/* seconds and AM or PM */
print "<img src=\"$seconds1.gif\"><img src=\"$seconds2.gif\"><img src=\"$time_ampm\">"