Anyone knows how to do it?
What I know is time()
but it's pure digits..
To obtain a formatted date/timestamp use the date()
function
$dt = date('Y-m-d H:i:s');
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');