NOW() function in PHP

前端 未结 20 1670
遥遥无期
遥遥无期 2020-11-28 17:26

Is there a PHP function that returns the date and time in the same format as the MySQL function NOW()?

I know how to do it using date(), b

20条回答
  •  爱一瞬间的悲伤
    2020-11-28 17:50

    My answer is superfluous, but if you are OCD, visually oriented and you just have to see that now keyword in your code, use:

    date( 'Y-m-d H:i:s', strtotime( 'now' ) );
    

提交回复
热议问题