I need to get the current timezone but Time.now.zone
only has options for the abbreviation. Poked around in the docs and couldn't find anything useful. Is this possible?
Asked
Active
Viewed 1,184 times
1
-
I don't think this functionality is built into the ruby language. If you are using rails you could call `Time.zone.name` however. – Andy Stabler Feb 16 '18 at 17:19
-
What OS are you using? On Win, I see that it returns full name; on Ubuntu, it's abbreviated. – orde Feb 16 '18 at 17:21
-
@orde ah yeah that's what it is I'm on Ubuntu. I think at this point it's easiest to just make a mapping of gmt offset --> full name. – Niko Feb 16 '18 at 17:27
-
No, you cannot make that mapping. See "time zone != offset" in [the timezone tag wiki](https://stackoverflow.com/tags/timezone/info). – Matt Johnson-Pint Feb 16 '18 at 18:18