WordPress.org

Make WordPress Core

Opened 11 months ago

Last modified 11 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:

Description

Hi

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
11 months ago

  • Component changed from General to Date/Time

#2 @Rarst
11 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 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 11 months ago by Rarst (previous) (diff)

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