Mysql在12月31日14:25保存文章,但数据函数显示2019年的日期

Mysql save the article like that: 2018-12-31 14:25:37. But on the website the date is like that: 31 December 2019, 2:25 pm. Here is my code.

date("d F o, g:i a", strtotime($article->created_at))

The data show show right year.

o is for ISO-8601 week-numbering year:

This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. (added in PHP 5.1.0)

You should use Y:

date("d F Y, g:i a", strtotime("2018-12-31 14:25:37"))
// 31 December 2018, 2:25 pm