Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $mins = h2m(1.3);
- echo date('Y-m-d H:i:s', strtotime("2016-04-01 15:00:00 + {$mins} minutes"));
- function h2m($hours) {
- $t = EXPLODE(".", $hours);
- $h = $t[0];
- IF (ISSET($t[1])) {
- $m = $t[1];
- } ELSE {
- $m = "00";
- }
- $mm = ($h * 60) . $m;
- return $mm;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement