Jekyll 1.5.1 likes my timezones again

Promotional artbook image of the K-On! girls for their London movie

At some point in the most recent branch, my Jekyll setup began falling over itself with timezones in timestamps. I hesitated to call it a general bug, given I use Jekyll in a fairly custom way. In any case, this was a serious issue given I’ve written this blog from a dozen different timezones over its nine year history, including a couple that were more than 12 hours apart.

(To be fair, Jekyll still performs far better than WordPress ever did for timezones, particularly when I was living in Singapore and studying in Adelaide, Australia. My late night SQL adventures with that are for another post).

My solution, at the time, was to bypass the bug by moving the offending timezone to its own front matter “tz” attribute. This necessitated adding extra post.tz Liquid markup everywhere where dates were handled, then writing a custom date mask that didn’t convert the time to UTC, but supressing the automatically added timezone. It was a horrible hack, but it worked:

layout: post
title: "Clara and Ruben's Singapore-KL-Tokyo-Seoul-HK-Taipei trip"
date: "2014-04-05T11:33:10
tz: "+1100"
hash: [goop]

With the most recent 1.5.1 release, I noticed most of my posts were off by a day. It prevented me writing my post yesterday, on account of not wanting to mess up timestamps for thousands of posts.

Fortunately, this failure was for a wondrous reason; Jekyll now recognises my timezones again! A quick regex to remove text and a newline, regenerate my post hashes, and my dates are now properly parsed:

layout: post
title: "Clara and Ruben's Singapore-KL-Tokyo-Seoul-HK-Taipei trip"
date: "2014-04-05T11:33:10+1100
hash: [different goop]

I’ll be marking my earlier hack post as hysterical historical. Thank you Jekyll team and contributors, you made this guy’s day :”).

K-On! promotional movie artwork © Kyoto Animation 京都アニメーション


Imprint

This is one of about 5000 posts on Rubénerd. View the home page for the latest, or related posts also tagged with:

If you liked this post, feel free to buy me a coffee, leave me a comment on Twitter, or email me at weblog2017@rubenschade.com. Thanks :).