This question already has an answer here:
I need to get the date in a specific format in PHP.
The format is: "YYYY-MM-DD, JJ:NN:SS"
Example: "2018-04-01, 00:00:01"
I'm not sure how to get this in PHP without some hacks. How can I get this date format in PHP?
</div>
This way:
$date->format('Y-m-d, H:i:s');
Live demo. You can find more possible format placeholders in the documentation.