Select date from my db without seconds using PHP MySql

后端 未结 6 1931
生来不讨喜
生来不讨喜 2020-12-20 06:25

Well, I save the date\'s with minutes and second in my database.

And I want to check if the date from my db = to date today.

I read about this,

6条回答
  •  -上瘾入骨i
    2020-12-20 07:05

    You just need simple conversion when you are having ur date in varchar. Your query should be like:

    SELECT DATE_FORMAT('2015-08-21 12:35:15', '%Y-%M-%d %H:%i');
    

    OUTPUT

    2015-August-21 12:35
    

提交回复
热议问题