In my project, I've different " locale " : en, fr, ... We can see it in the URL as localhost:3000/ \locale\ /......
I search gem or methods to make a relation between this locate and timezone. In fact, I don't want to use OS timezone but timezone depending on my URL.
I specify that I'm french and a new developer on Rails.
Thanks you for your future answer.
Locales generally don't have enough information to specify the time zone. For example:
en
just means "English" - is that in the US? The UK? Canada? Australia? Somewhere else?en-US
covers the whole of the US, which has multiple time zonesAdditionally, just because a user wants to see content formatted according to a particular locale, that doesn't mean they necessarily want to use that time zone. For example, I might be in France (and using the Paris time zone) but still want the page rendered in English. What would your URL do then?
(As an aside, usually the locale would be inferred from headers or URL parameters rather than as part of the URL path...)
You haven't told us anything about the project, but I would suggest trying to keep different concepts separate from each other.
See more on this question at Stackoverflow