Overriding system timezone when formatting time #492

Closed
komiga opened this Issue Jan 30, 2012 · 4 comments

Comments

Projects
None yet
6 participants
@komiga

komiga commented Jan 30, 2012

Say there is a DateTime of 2012-01-30T09:52:24-05:00; it specifies a specific timezone which is lost when formatting the object to a string (via the date and date_to_xmlschema filters, for example). When the object is formatted, it will use the host system's timezone, which is an issue for someone who would wish to format the time in a particular timezone.

Suggestions/requests:

  1. Add a timezone configuration field that will override the system's timezone; or
  2. Add a timezone parameter to current time formatters (or a new formatter).

This is mainly an issue only when hosting on a site that doesn't give you the ability to use plugins (such as GitHub, which is causing the issue in my case). I've never used Ruby before so I don't know how feasible this is. I also am not certain what the exact cause is -- whether the parsing of a date-time string is converting the time to the system's timezone or whether the formatting of the object specifies the timezone.

@osuka

This comment has been minimized.

Show comment Hide comment
@osuka

osuka Jun 18, 2012

For what is worth, I discovered this the hard way. It's more of a ruby thing than a Jekyll specific issue.

When you travel abroad and your system timezone changes, dates generated don't use the timezone properly for formatting (or rather, don't know that you generated your site with a different timezone before). This is normally not a big problem but it breaks links when the date in a URL path changes. For example, when you have "23:00h +0200" and similar you may find yourself moved to the next or previous day.

My solution: I always run Jekyll via a small script containing just a command like this:

TZ="CET" jekyll

That sets the timezone to CET which is what I was originally using, and even though I have moved I must keep it otherwise it generates wrong timestamps for atom feeds which mess with the RSS readers, plus some links change when the day on a date changes (bad for SEO).

osuka commented Jun 18, 2012

For what is worth, I discovered this the hard way. It's more of a ruby thing than a Jekyll specific issue.

When you travel abroad and your system timezone changes, dates generated don't use the timezone properly for formatting (or rather, don't know that you generated your site with a different timezone before). This is normally not a big problem but it breaks links when the date in a URL path changes. For example, when you have "23:00h +0200" and similar you may find yourself moved to the next or previous day.

My solution: I always run Jekyll via a small script containing just a command like this:

TZ="CET" jekyll

That sets the timezone to CET which is what I was originally using, and even though I have moved I must keep it otherwise it generates wrong timestamps for atom feeds which mess with the RSS readers, plus some links change when the day on a date changes (bad for SEO).

@maul-esel

This comment has been minimized.

Show comment Hide comment
@maul-esel

maul-esel Apr 17, 2013

Contributor

@parkr: seems like #957 should have solved this?

Contributor

maul-esel commented Apr 17, 2013

@parkr: seems like #957 should have solved this?

@parkr

This comment has been minimized.

Show comment Hide comment
@parkr

parkr Apr 18, 2013

Owner

Yes! Thanks for catching this. Closing.

Owner

parkr commented Apr 18, 2013

Yes! Thanks for catching this. Closing.

@parkr parkr closed this Apr 18, 2013

@AileenCGN AileenCGN referenced this issue in TryGhost/Ghost May 4, 2016

Closed

Add & use a global blog timezone #6406

@jekyllbot jekyllbot locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.