Save 25% on Wizard’s SQL for WP w/ code: WIZARDSQL
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. Security Specialist. WordPress Buff.
GA Pro: Add Google Analytics to WordPress like a pro.
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 »
The Tao of WordPress: Master the art of WordPress.
Thoughts
Plugin updates! All of our free and pro plugins ready for WordPress 6.2.
Daylight savings is a complete waste of time and needs to be eliminated.
Got a couple of snow days here in mid-March. Fortunately it's not sticking.
I handle all email in real time as it comes in, perpetually clear inbox for years now.
Added some nice features to Wutsearch search engine launchpad. Now 21 engines!
.wp TLD plz :)
Nice collection of free SEO APIs and user-agent lookups for Googlebot, Bingbot, Applebot, YandexBot, and more.
Newsletter
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.