Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @author Genesis730
- * @copyright 2011
- */
- date_default_timezone_set('MST');
- $hms = date('H:i:'."00"); /// MST is Arizona time please adjust to either server timezone or your timezone
- define("FUEL", "320");
- list($hrs,$mins,$secs) = explode(':',$hms);
- $minutes = $mins / 60;
- $minutes2 = sprintf("%d", $minutes*100);
- $formatted = $hrs .".". $minutes2;
- $cost = $minutes*FUEL;
- $cost = sprintf("%0.02f", $cost);
- $cost = "£".$cost;
- echo "Fuel Cost: £".FUEL." / hour<br />"
- ."Current time: ".$hms." (seconds rounded down to 00)<br />"
- ."Minutes past the hour: ".$mins."<br />"
- ."Minutes as a decimal: ".$minutes."<br />"
- ."Fuel cost since ".$hrs.":00 ".date('A')
- ." - ".$cost;
- echo "<br /><br />".$min;
- echo "<br />formatted time: ".$formatted;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement