Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#49879 new defect (bug)

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

Reported by: dranilsinghal's profile 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
3 years ago

  • Component changed from General to Date/Time

#2 @Rarst
3 years 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 niche one.

My personal recommendation, for a private site, is to 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.

Last edited 3 years ago by Rarst (previous) (diff)

#3 @dranilsinghal
3 years 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.