Created
December 9, 2013 01:30
-
-
Save SemanticallyNull/7866179 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
date_default_timezone_set('Europe/Dublin'); | |
// SET ME TO THE BASE YOU WANT | |
const BASE = 8; | |
function o($v) { | |
$u = floor(pow(60, 1/BASE)); | |
for($i=$u;$i>=0;$i--) { | |
$set = false; | |
$vn = pow(BASE,$i); | |
for($y=(BASE-1);$y>=1;$y--) { | |
if($v >= $vn*$y) { | |
echo $y; | |
$set = true; | |
$v -= ($vn*$y); | |
} | |
} | |
if(!$set) { echo "0"; } | |
} | |
echo "\n"; | |
} | |
if(BASE > 10) { die('Sorry, I can\'t handle big bases'); } | |
while(true){ | |
$now = new DateTime(); | |
echo "H:\t";o($now->format("h")); | |
echo "M:\t";o($now->format("i")); | |
echo "S:\t";o($now->format("s")); | |
echo "\033[3A"; | |
usleep(500000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment