最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Are there any know limitations on the date field, especially how old dates can be?

programmeradmin0浏览0评论

Our site needs a way to order a large number of posts (think +6000). After looking at some plugins I have decided to just use the date field since it is built into wordpress. It's kind of silly, but it will meet our need and hopefully be compatible with any future iterations of the WordPress software or plugins.

Is there a limit to how far back in time posts can be dated? We shouldn't have to go so far back, but I just wanted to check if anyone knew.

Our site needs a way to order a large number of posts (think +6000). After looking at some plugins I have decided to just use the date field since it is built into wordpress. It's kind of silly, but it will meet our need and hopefully be compatible with any future iterations of the WordPress software or plugins.

Is there a limit to how far back in time posts can be dated? We shouldn't have to go so far back, but I just wanted to check if anyone knew.

Share Improve this question asked Jun 29, 2020 at 3:00 HopefullCoderHopefullCoder 456 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

Almost every PHP date/time function is dealing with the UNIX epoch timestamp, which starts from 00:00:00 UTC on 1 January 1970. So I strongly encourage you not to use dates before 01.01.1970 to avoid incompatibilities with the most of PHP code used by third party plugins.

Wordpress posts table uses DATATIME type for all the date columns and this is the only limit You will face.

From oficial mysql documentation:

The DATETIME type is used for values that contain both date and time parts. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD hh:mm:ss' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.

发布评论

评论列表(0)

  1. 暂无评论