Hi
I’m working on an event webpage where content creators could enter new events on Netlify CMS. I got the Netlify CMS UI part but a bit confused about how to display dates and times to the visitors.
Let’s say the content creator is located in Germany and creates an event on CMS at 16.00 GMT +1. According to Netlify Documentation Netlfiy CMS stores timestamps as datetime
objects in UTC by default. ( if I don’t set locale
to any moment.js token such as LLL
)
My question is what is the best practice to display this date-time to the visitor in his local time?
- If I use ruby methods such as
time.getlocal
in my .erb templates, Middleman will build it based on the local time zone of the build environment, is it true? - Is there a method to get the time zone of the visitor from her browser then use it in the template? Is it possible to do it without using javascript or any .js based library such as moment.js?
- How to fix the time zone of the build environment on config.rb?
Thanks