Blosxom Date Problem Fixed

With a little digging in code, I found out why my blosxom dates were screwing up. This morning was particularly bad, in that the first entry said “Wednesday March 10”, the second said “Thursday, March 11” and the third was back to the 10th. I’ve long suspected there was a timezone issue in here, because the screwed up entries were always with things after 6 PM and I’m 6 hours from GMT when we are on standard time. By adding some data printing in the middle of blosxom, I was able to figure out that the first time the date was “prettified” it was correct and all subsequent ones were off by 6 hours. I also was seeing the print in the date function twice per file yet it was only called once in the blosxom code. Add in the fact that the very first time, the first print was right and the second for that file was screwed up and this led me to believe a plugin was doing it. I grepped for “nice_date” in my plugin directory and found one and only one that uses it: atomfeed (which I only ever installed on a whim anyway, I don’t really use it or publicize it.) I removed it from the plugin directory and voila, everything was fixed.

By examining what the plugin does, I tracked it down to the fact that atomfeed wants the date in both local time and in UTC. It does this by setting the environment’s TZ value first to “GMT” and then back to the original. Well, on my box that isn’t set in the environment so after the first time through all the times from then on out are in UTC. This explains why I would see all the right entries on the day by day view because that filtering happened before atomfeed rewrote the timezone. and why I would see the evening entries on the following day. For now, I just got rid of atomfeed. If I can see a why to fix their code to soemthing less destructive, I’ll put it back in and communicate my changes to the developers.

Published by

dave

Dave Slusher is a blogger, podcaster, computer programmer, author, science fiction fan and father. Member of the Podcast Hall of Fame class of 2022.