Fall Sale! Code FALL2024 takes 25% OFF our Pro Plugins & Books »
Web Dev + WordPress + Security

Time Test

This post exists entirely for the sake of tweaking time functionality in Apache, PHP, SQL, and WordPress..

Immediate findings:

  • Date/time limit into the past for WordPress: December 13, 1901 @ 15:45
  • WordPress will display December 13, 1901 @ 15:45 properly for all functions except wp_get_archives
  • All dates prior to 12/13/1901 in MySQL will display as December 31, 1969 @ 19:00 in the WP Admin > Post Timestamp panel
  • SQL timestamps of 0000-00-00 00:00:00 display as 0 via $wpdb->get_col("SELECT DISTINCT YEAR
  • SQL timestamps of 0000-00-00 00:00:00 display link as the current year when permalinks are enabled
  • An SQL timestamp of 1000-00-00 00:00:00 displays link as 1000 and links to the post
  • An SQL timestamp of 1000-00-00 00:00:00 displays correctly in archive view, but incorrectly in Admin and post view
  • An SQL timestamp of 1950-00-00 00:00:00 displays as November 30, 1949 @ 00:00 in WP Admin Post Timestamp panel and elsewhere in WordPress
  • An SQL timestamp of 1950-01-01 01:01:01 displays properly in WP Admin, and elsewhere
  • 0001-01-01 01:01:01 displays as January 01, 2001 @ 01:01 in Admin, links to 1 in archives (404 error)
  • 1000-01-01 01:01:01 displays correctly in archive, as December 31, 1969 @ 15:59 in Admin and post view
  • 3000-01-01 01:01:01 displays correctly in archive, as December 31, 1969 @ 15:59 in Admin, and 404 as post view
  • 2050-01-01 01:01:01 displays correctly in archive, as December 31, 1969 @ 15:59 in Admin, and 404 as post view
  • January 19, 2038 3:14:08 AM GMT is the latest date that will appear correctly in the WP Admin
  • No posts with future date will appear in post view
  • An SQL timestamp of 1900-01-01 01:01:01 displays correctly in daily, monthly, and yearly archive views
  • An SQL timestamp of 1900-01-01 01:01:01 now displays January 18, 2038 @ 19:14 in Admin
  • My head hurts..

More to come.. (much, much later..)

About the Author
Jeff Starr = Web Developer. Security Specialist. WordPress Buff.
Banhammer: Protect your WordPress site against threats.
Welcome
Perishable Press is operated by Jeff Starr, a professional web developer and book author with two decades of experience. Here you will find posts about web development, WordPress, security, and more »
WP Themes In Depth: Build and sell awesome WordPress themes.
Thoughts
I disabled AI in Google search results. It was making me lazy.
Went out walking today and soaked up some sunshine. It felt good.
I have an original box/packaging for 2010 iMac if anyone wants it free let me know.
Always ask AI to cite its sources. Also: “The Web” is not a valid answer.
All free plugins updated and ready for WP 6.6 dropping next week. Pro plugin updates in the works also complete :)
99% of video thumbnail/previews are pure cringe. Goofy faces = Clickbait.
RIP ICQ
Newsletter
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.