I know this question has been asked before but somehow I am not able to get this to work in my project so please advise
my php code ( this if else is for checking if time was set or not )
if (isset($_POST['startDate']) && isset($_POST['startTime']))
{
$date = $_POST['startDate'] . " " . $_POST['startTime'];
$date = new DateTime($date);
$date->setTimezone(new DateTimeZone('UTC'));
// $date = date('Y-m-d H:i:s', $date);
} else
{
$date = date('Y-m-d H:i:s');
$date = new DateTime($date);
$date->setTimezone(new DateTimeZone('UTC'));
}