Pete's Log: Altering the past

Entry #2024, (Meta)
(posted when I was 43 years old.)

As usual: rabbit hole presents itself, Pete jumps down it. All I wanted to do was make my default time zone work smarter in advance of the upcoming time change.

I'm not going to say I implemented time zones wrong when I added time zone support 14 years ago (holy cow), because it works for my use case and feels relatively future proof (times are stored in UTC with an offset in addition to a time zone description). But I will say that I'd probably do it slightly differently today. However, some of the PHP features I would use if I were to rewrite the code weren't introduced until PHP 5.2, and I can't say for sure if that was available to me at the time (it was released about 9 months earlier). So I'm not going to rewrite it, but I did make a couple tweaks. The main one being that I now store my default time zone as the name of a PHP/tz time zone (e.g. America/Chicago) instead of as a name like "CDT". This way I can ask PHP if it is currently DST or not in that time zone and then pick e.g. CST or CDT appropriately.

So far so good. Then with time zones on my mind I thought it'd be fun to add a time zone section to the stats page.

When I was initially prepping for time zone support, I marked everything prior to 2003 as EST, but have since realized that a decent chunk of those entries was written from Colorado and elsewhere. I haven't exhaustively identified everything, but it was easy to find some big chunks (summer of 2000, Christmas of 2000 and 2001) that needed relabeling. If I was going to have statistics I figured I should put in some effort to make the statistics accurate. And then the rabbit hole truly swallowed me. I discover log entry 309 in which I state that it is 11:30 pm, but which now has a timestamp of 6:34 pm MDT. A five hour time discrepancy automatically puts me on alert, as that is the difference between EST and UTC. I click around a little more and realize that even though I have no further concrete evidence, it does look likely that all entries of summer 2000 are off by 5 hours.

I was able to definitively bookend the issue with entry 279 and entry 533 that both note a specific time and have timestamps that correctly match that time. My working theory is that when I moved out of the dorm in May of 2000, esgeroth.org moved from being hosted in my dorm to being hosted somewhere in Fitzpatrick or Cushing. And in doing so, something changed about the time zone configuration. And somehow I didn't notice or care that timestamps were off. Then in August of 2000 when I rewrote the Pete's Log backend, I fixed it.

I spent way too much time going through old entries to try to narrow this down. I can't be completely positive about the exact start and end of the time issue, but it feels the most right to align it with moving out of the dorm and rewriting the backend. And I think that's pretty close to the right range. So for future reference if future me is ever battling time discrepancies again, today I added 5 hours to each entry between entry 297 and entry 397 (inclusive).

In the process of searching for time zone related posts, I found a todo from 2009 noting that I needed to change the time zone of that entry to GMT. So if nothing else, today I accomplished a task I set for myself twelve years ago.

Just for fun, here are a couple before and after pictures of time-related statistics. The "Before" is on the left or on top of the "After" picture.

No alt text found for this picture. Please email prijks@esgeroth.org to complain.

No alt text found for this picture. Please email prijks@esgeroth.org to complain.

And since having a reference to the current time in the entry text every once in a while proved helpful, here we go: it is 11:16 pm Central Daylight Time. Way past my bedtime.