Skip to content

Instantly share code, notes, and snippets.

@dragonfire1119
Last active December 18, 2015 17:38
Show Gist options
  • Save dragonfire1119/5819539 to your computer and use it in GitHub Desktop.
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 :)
<?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