Blog Pile

Feed2JS Clock Has Been Off For Years

Thanks to some keen observers who have recently noted a long standing problem with Feed2JS— for the display of the date and item was posted, we had been using some Magpie and PHP functions to convert the date/time stamp of an item to a milliseconds value and then using the php date() function for the screen display. Yet I was overlooking the fact that the functions were converting the time into one relative to the local time on my server.

Of course, when testing against this blag, the date/time stamps were okay since its on the same server and in the same timezone.


To calculate the time zone offset will take some effort since the date/time formats of feeds have about 5-10 different variations. One option is to include a new parameter that will allow a user to indicate the timezone offset from our local time– this can be as simple as the build page displaying our local time and giving a drop down menu to select offsets from +12 to -12 to correct the offset.

Until I figure that, I have recoded the date/time stamping to just use whatever string is provided in the feed item; and some simple clean up such as removing “Z” from Atom date/times, and stripping the time zone offsets from RSS 1.0 feeds. Please let me know if you see anything weird.

This means, for the past 2 years or so, y’all been displaying feeds in Arizona time! Maybe no one minded…

If this kind of stuff has any value, please support me monthly on Patreon or a one time PayPal kibble toss
Profile Picture for Alan Levine aka CogDog
An early 90s builder of the web and blogging Alan Levine barks at on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person.


Comments are closed.