admin管理员组

文章数量:1334931

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'.

本文标签: Are there any know limitations on the date fieldespecially how old dates can be