Anyone knows how to do it?
What 开发者_JS百科I know is time()
but it's pure digits..
As you've said, you can get the current timestamp via the time function. You can then pass this timestamp to PHP's date function. (It'll use the current time if no timestamp is provided.)
The specific format you're after is:
date('Y-m-d H:i:s');
To obtain a formatted date/timestamp use the date()
function
$dt = date('Y-m-d H:i:s');
精彩评论