Last active
December 18, 2015 17:38
-
-
Save dragonfire1119/5819539 to your computer and use it in GitHub Desktop.
This is to help people with calculating time. It's not a perfect example but it gets to the point.
Hope it helps somebody :)
This file contains 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 | |
$a = '1371688131'; | |
$b = time(); | |
$diff = ($b - $a); | |
if ($diff/60 > 30) { | |
echo "This is over 30 minutes"; | |
} else { | |
echo "This is " . $diff/60 . " minutes"; | |
} | |
echo "<hr />"; | |
$str = "27.8166666667"; | |
$minusthis = "30"; | |
$negit = ($minusthis - substr($str, 0, 2)); | |
echo "Time until unlocked " . $negit . " minutes"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment