PHP, How to get current date in certain format

前端 未结 3 519
慢半拍i
慢半拍i 2020-12-05 12:59

2011-03-04 21:00:40

I want to get current date and time in the above format. How do I do this in PHP?

相关标签:
3条回答
  • 2020-12-05 13:17
    date("Y-m-d H:i:s"); // This should do it.
    
    0 讨论(0)
  • 2020-12-05 13:22

    date('Y-m-d H:i:s'). See the manual for more.

    0 讨论(0)
  • 2020-12-05 13:24

    I belive the answer is:

    echo date('Y-m-d H:i:s');
    
    0 讨论(0)
提交回复
热议问题