How do I get the current date and time in PHP?

后端 未结 30 2131
孤城傲影
孤城傲影 2020-11-22 08:19

Which PHP function can return the current date/time?

30条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 09:01

    You can either use the $_SERVER['REQUEST_TIME'] variable (available since PHP 5.1.0) or the time() function to get the current Unix timestamp.

提交回复
热议问题