Make WordPress Core

Opened 20 months ago

Last modified 20 months ago

#49879 new defect (bug)

Can't create or save post if post date is less than 13 Dec 1901

Reported by: dranilsinghal Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.4
Component: Date/Time Keywords:
Focuses: Cc:



I just noticed that wordpress 5.4 can't create or save post if post date is less than 13 Dec 1901, and can't display the post date if post date is less than 14 Dec 1901.

Please check...

Change History (3)

#1 @SergeyBiryukov
20 months ago

  • Component changed from General to Date/Time

#2 @Rarst
20 months ago

This is a very interesting topic, since post dates possible in WP are determined by a complex intersection of MySQL, PHP, and WP's own limitations. I had enumerated date limitations extensively in the past.

The one specific 1901 limit you observe to is caused by a lowest possible negative integer timestamp on 32-bit PHP. It should go away on 64-bit PHP installation, but you would still hit other limits.

Effectively WP isn’t engineered for working with backdated historical posts. I think it's a valid and interesting use case, but also a very edge case one.

My personal recommendation, for a private site, is too store historical dates as custom fields and handle them with your own code.

At the moment there is no explicit intention to support or not support them in core.

Version 0, edited 20 months ago by Rarst (next)

#3 @dranilsinghal
20 months ago

Thanks @Rarst for extensive explanation of my issue as I was working on a historical site.
Thanks for solution as well.
Best regards.

Note: See TracTickets for help on using tickets.