A binary clock in PHP

There are some odd functions hidden in PHP. One of them is the decbin function, which makes it easy to convert between decimal and binary numbers.

If you’re bore don a rain day, you could use this function to make a simple binary clock, here’s a few lines to get you started:

echo "Hours: ".decbin(date("H"))."<br>";
echo " Minutes:".decbin(date("i"))."<br>";
echo " Seconds:".decbin(date("s"));

See the binary clock output (and the source of the page).