Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jekyll 1.4.0 seems to not care what I set "timezone:" to #1792

Closed
jmhodges opened this issue Dec 9, 2013 · 10 comments
Closed

jekyll 1.4.0 seems to not care what I set "timezone:" to #1792

jmhodges opened this issue Dec 9, 2013 · 10 comments
Milestone

Comments

@jmhodges
Copy link
Contributor

jmhodges commented Dec 9, 2013

With a post with the front matter like:


---
title: Foobar Baz
date: 2013-12-09 08:15:00 -08:00
layout: post

---

and an index.html that renders the date as:

{{post.date | date: "%B %d, %Y %I:%M %p %Z"}}

and a _config.yml like:

timezone: "America/Los_Angeles"

the date is always printed with "UTC" as the timezone, changing it into:

December 09, 2013 04:15 PM UTC

No combination of setting TZ or formatting the date differently seems to work. This is on ruby 1.8.7.

@jmhodges
Copy link
Contributor Author

jmhodges commented Dec 9, 2013

Oh, and my gem list (all of which were installed specifically for jekyll):

*** LOCAL GEMS ***

blankslate (2.1.2.4)
classifier (1.3.3)
colorator (0.1)
commander (4.1.5)
fast-stemmer (1.0.2)
ffi (1.9.3)
highline (1.6.20)
jekyll (1.4.0)
json (1.8.1)
liquid (2.5.4)
listen (1.3.1)
maruku (0.7.0)
parslet (1.5.0)
posix-spawn (0.3.8)
pygments.rb (0.5.4)
rb-fsevent (0.9.3)
rb-inotify (0.9.2)
rb-kqueue (0.2.0)
redcarpet (2.3.0)
safe_yaml (0.9.7)
syntax (1.0.0)
toml (0.1.0)
yajl-ruby (1.1.0)

@parkr
Copy link
Member

parkr commented Dec 9, 2013

If you open up irb, does require 'time'; Time.parse("2013-12-09 08:15:00 -08:00") work?

@jmhodges
Copy link
Contributor Author

jmhodges commented Dec 9, 2013

Yep!

require 'time'; Time.parse("2013-12-09 08:15:00 -08:00")
=> Mon Dec 09 08:15:00 -0800 2013

(Note that the time in the original example correct, too. It's just shifted by the right amount to be in UTC.)

@parkr
Copy link
Member

parkr commented Dec 9, 2013

So it's only the frustration that {{ date }} always prints out a UTC string. If TZ, and timezone are set and there's an offset in your original string, you should be good to go. Time bending is so weird.

@jmhodges
Copy link
Contributor Author

jmhodges commented Dec 9, 2013

But those don't help, that's the bug.

@wdenton
Copy link
Contributor

wdenton commented Jan 13, 2014

I have the same problem (with Jekyll 1.4.2 and Ruby 2.1.0). I've set

timezone = America/Toronto

but a line like

date | date_to_rfc822

converts a page or post timestamp that I entered as -0500 to being in UTC (-0000).

@ivantsepp
Copy link
Contributor

This should be fixed by #1886. Could you try using the master branch in Jekyll to see if your problem is resolved?

@wdenton
Copy link
Contributor

wdenton commented Jan 14, 2014

Works perfectly!

@duelinmarkers
Copy link

When might we expect gh-pages to have the #1886 fix? It's not clear to me what fixes get onto the 1.x-stable branch or what the purpose of the gh-pages branch is. If there's some explanation of all this, please point me at it. I didn't see anything on the jekyll wiki.

@parkr
Copy link
Member

parkr commented Feb 8, 2014

It appears #1942 has fixed this. Closing. Will release an Alpha of 2.0.0 soon with this fix.

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

No branches or pull requests

6 participants