[PHP] 取得目前時間

PHP 取得目前時間的一行程式碼:date('Y-m-d H:i:s', time()),輸出 YYYY-MM-DD HH:MM:SS 格式的日期時間字串。

很簡單,也很常忘,所以記下來 Orz

$now =date("Y-m-d H:i:s",time());

comments powered by Disqus
Powered by Hugo. Theme Stack. All Rights Reserved.