ashfurrow / blog

This is my website, a static site generated with Gatsby.
https://ashfurrow.com
Other
112 stars 50 forks source link

Article Dates Misleading #98

Closed ashfurrow closed 9 years ago

ashfurrow commented 9 years ago

When you create a new article, it bases the time off of UTC. So after 8pm in NYC, I'll get an article that says it was published tomorrow.

:\

Unfortunately, editing the template is insufficient because this changes the build depending on where the build is made.

-date: <%= @date %>
+date: <%= @date.localtime %>

I can set the timezone in the config.rb file, but only as I'm in that timezone:

Time.zone = "US/Eastern"

What happens when I move? Also, changing this means a tonne of articles' frontmatter no longer matches their filename. Plus middleman infers UTC when generating, so giving a local time won't change the date middleman displays.

ashfurrow commented 9 years ago

I don't often publish more than once a day, and I don't even list the specific time of day that a post is published on. I think given how often I'm on the go, a technical solution isn't feasible. I'm just going to have to be aware of timezones when I publish things and modify the time component of the post to match a UTC time that reflects my local date.