php获取当前时间的方法 1、获取当前时间 date('Y-m-d H:i:s', time()) 2、字符串转时间 date('Y-m-d H:i:s',strtotime('2018-8-21 22:00:00'))