Save up to 25% on pro security plugins w/ our Security Bundle »
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..)

Jeff Starr
About the Author
Jeff Starr = Web Developer. Book Author. Secretly Important.
The Tao of WordPress: Master the art of WordPress.
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 »
.htaccess made easy: Improve site performance and security.
Thoughts
Fall season almost here :)
My greatest skill on social media is the ability to simply ignore 98% and keep scrolling without interacting.
Enjoying this summer, getting some great positive energy. Refreshing and inspiring.
☀️ Pro plugin giveaway! Enter to win 1 of 4 lifetime licenses for our WordPress security plugins, including 10-site Security Bundle!
There is no end to what humans can achieve when they work together.
Excellent (and free) tool to test your site's SSL configuration.
Plugin updates! All of our free and pro plugins ready for WordPress 6.2.
Newsletter
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.