Hi, I have been using Jekyll for years, but most of my site’s content is meant for consumption in the Pacific Northwest (America/Los_Angeles) and so I have not run into the problem that I am now experiencing.
I have a site, for an author based here in the PNW who must go on a book tour.
# _config.yaml
Timezone: America/Los_Angeles
She would like to announce events on her website - and so I have set up the following:
#_posts/2024-01-27-post-title.md
---
title: "Post Title"
date: 2024-01-27T00:00 America/Los_Angeles
event-date: "2024-02-05 20:00 America/New_York"
---
and…
#_layouts/post.html
~
{{ page.event-date | date: "%b %d, %Y %I:%M %p %Z %z" }}
~
note: I am displaying both the TZ Label (%Z) and the TZ 0ffset (%z%) for debugging purposes only.
The output of this is: Feb 05, 2024 08:00 PM PST -0800
I arrived at using IANA timezone designators for each of these time values because of this post: Timezone global configuration problem Which I found allowed me to display PST rather than -0800 etc… Prior to that I was using numeric timezone offsets (-0800, -0500 etc and I found those to be confusing to folks reading the site – so labels like PST and EST are more desirable.
Anyway, if you look at the config.yml and at the post you should see that I have designated different timezones and so I expect Jekyll to either give me output appears in Pacific Time (-0800)
Feb 05, 2024 05:00 PM PST -0800
OR better, I expect output in Eastern Time (-0500)
Feb 05, 2024 08:00 PM EST -0500
Now, I have read that Jekyll when configured properly will only show times in the timezone configured in _config.yml
and that would meet my first expectation - except that Jekyll is not doing the math to display 5 PM pacific.
So, I guess my question is, what am I doing wrong here for Jekyll to not be doing the math and giving me the correct time in PST.
My second question (icing on the cake) is is there a way I can get the event date to appear in the event’s local timezone?
Thanks for you help in advance.
Bill