Reputation: 305
Here i have a date entry as by default mysql
Input: '2017-03-9 06:27:28'
Output: '2017-03-9 11:27:28'
i want to convert this time using php
in GMT +5 format please help me the function to solve this
Upvotes: 1
Views: 53
Reputation: 15141
$string=strtotime("2017-03-9 06:27:28"); //converting time to timestamp
$timestamp=strtotime("+5 hours",$string);//added zone time
echo date("Y-m-d H:i:s", $timestamp); //displaying new time
Upvotes: 2