Make WordPress Core

Opened 4 years ago

Closed 9 months ago

Last modified 9 months ago

#49879 closed defect (bug) (wontfix)

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

Reported by: dranilsinghal's profile dranilsinghal Owned by:
Milestone: 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 (5)

#1 @SergeyBiryukov
4 years ago

  • Component changed from General to Date/Time

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

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

#4 @Presskopp
9 months ago

  • Resolution set to wontfix
  • Status changed from new to closed

I read the last reply as "it's ok for me", so closing the ticket..

#5 @peterwilsoncc
9 months ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.