Skip to content

Instantly share code, notes, and snippets.

@SemanticallyNull
Last active December 30, 2015 18:09
Show Gist options
  • Save SemanticallyNull/7865671 to your computer and use it in GitHub Desktop.
Save SemanticallyNull/7865671 to your computer and use it in GitHub Desktop.
<?php
date_default_timezone_set('Europe/Dublin');
function o($v) {
for($i=3;$i>=0;$i--) {
$set = false;
$vn = pow(3,$i);
for($y=2;$y>=1;$y--) {
if($v >= $vn*$y) {
echo $y;
$set = true;
$v -= ($vn*$y);
}
}
if(!$set) { echo "0"; }
}
echo "\n";
}
while(true){
$now = new DateTime();
echo $now->format("h i s")."\n";
echo "H:\t";o($now->format("h"));
echo "M:\t";o($now->format("i"));
echo "S:\t";o($now->format("s"));
echo "\033[4A";
usleep(500000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment