Managing date formats differences between PHP and MySQL

后端 未结 7 1830
半阙折子戏
半阙折子戏 2020-12-09 13:53

I\'m writing my first PHP app that has to directly deal with dates, and thus to directly deal with the fact that PHP and MySQL have different date formats.

My questi

7条回答
  •  情深已故
    2020-12-09 14:28

    I think it would be a better ideea to store unix timestamps in the DB field. When you need to display dates to human language, you can always use php's date() function. For everything else, just use the numeric timestamp.

提交回复
热议问题