How to get GMT date in yyyy-mm-dd hh:mm:ss in PHP

前端 未结 6 1536
旧时难觅i
旧时难觅i 2020-12-16 10:08

I want to get the current date in yyyy-mm-dd hh:mm:ss format.

I have tried:

gmdate(\'yyyy-mm-dd hh:mm:ss \\G\\M\\T\', time());

Its retur

6条回答
  •  别那么骄傲
    2020-12-16 11:08

    Try this

    Check this How do i get the gmt time in php

    date_default_timezone_set("UTC");
    echo date("Y-m-d H:i:s", time()); 
    

提交回复
热议问题