SyntaxFix
Write A Post
Hire A Developer
Questions
Use strftime:
strftime
strftime("%F %T");
%F is the same as %Y-%m-%d.
%F
%Y-%m-%d
%T is the same as %H:%M:%S.
%T
%H:%M:%S
Here's a demo on ideone.