Given a date and an hour, I want to append that hour onto that date.
E.g: Given hour 3 and date 2017-05-30 I want: 2017-05-30 03:00:00
<?php
$d1 = date('Y-m-d');
$hour = 3;
$new_time = date("Y-m-d H:i:s", strtotime('+' . $hour .' hours', $d1));
echo $new_time;
?>
When running the following code I get:
Notice: A non well formed numeric value encountered on $new_time = date("Y-m-d H:i:s...
How can I get the proper output?