I have an input array data containing time in 'Y-m-d h:i:s' format and the gmt timezone data like this:

$time = array(
           "time" => "2017-11-01 12:00:12"
           "gmt"  => "+7"

i wish to convert the above time data into a date with format from magento locale config timezone, is there a way to do this?


You can try something like this:

foreach ($arr as $value) {
   echo $value['name'].' joined on [ Date: '.date('d M Y',strtotime($value['date'])).' , Time:'.date('H:i',strtotime($value['date']));
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.