I have many PHP files which are working fine in Azure. I recently shifted them to SmarterASP (with the same database, and properly connected) and then some of the same files show warning along with the output and that causes problems for the client. Here's one of the files:
<?php
$userTimeZone=$_GET['timezone'];
$offset=10;
$result['offset']=$offset;
$date=gmdate();
$date=date_create($date, new DateTimeZone("GMT"))
->setTimezone(new DateTimeZone($userTimeZone))->format("U");
$result['date']=$date;
echo json_encode($result);
?>
I get the correct output on Azure, provided the right input (?timezone=Asia/Kolkata
):
{"offset":10,"date":"1505538838"}
But on SmarterASP, for the same input, I get this:
Warning: gmdate() expects at least 1 parameter, 0 given in H:\root\home\lazimsoftware-001\www\eeandroid\androidwebservice\getDateFromServer.php on line 5 {"offset":10,"date":"1505538926"}
This is one case, there are others too. Hope I find a solution here. Thanks.