How to display the WordPress post date and modified date, if modified

December 31, 2019 , I learned...

Had to look this up, but it makes a lot of sense when it’s typed out. Grab the current date and the post date, then compare the two. If the difference is zero, then only show the post date. If the difference is one or higher, show both.

[[code markup="none"]]czoyOTY6XCI8ZGl2IGNsYXNzPVwicG9zdC1zaW5nbGVfX2RhdGVcIj4KICA8P3BocCAKICAkal90aW1lID0gZ2V0X3RoZV90aW1lKFwnalwne1smKiZdfSk7CiAgJGpfbW9kaWZpZWRfdGltZSA9IGdldF90aGVfbW9kaWZpZWRfdGltZShcJ2pcJyk7CiAgaWYgKCRqX21vZGlmaWVkX3RpbWUgPntbJiomXX09ICRqX3RpbWUgKyAxKSB7IAogICAgZWNobyB0aGVfZGF0ZShcJ0YgaiwgWVwnKTsKICAgIGVjaG8gXCJVcGRhdGVkOiBcIjsgdGhlX21vZHtbJiomXX1pZmllZF90aW1lKFwnRiBqLCBZXCcpOwogIH0gZWxzZSB7CiAgICBlY2hvIHRoZV9kYXRlKFwnRiBqLCBZXCcpOwogIH0gPz4KPC9kaXY+XCJ7WyYqJl19O3tbJiomXX0=[[/code]]