PHP Zend date format

后端 未结 6 1636
粉色の甜心
粉色の甜心 2021-02-19 08:12

I want to input a timestamp in below format to the database.

yyyy-mm-dd hh:mm:ss

How can I get in above format?

When I

6条回答
  •  情话喂你
    2021-02-19 08:23

    Not sure if this will help you, but try using:

     // to show both date and time,
     $date->get('YYYY-MM-dd HH:mm:ss');
    
     // or, to show date only
     $date->get('YYYY-MM-dd') 
    

提交回复
热议问题