Skip to content

Tag: datetime-format

get timezone in “+0100” (for example) format

I got lost between the documentation and the numerous time-related questions found by google. What I want is very simple: a string that represents the running timezone in the “[+/-] [number] [number] [number] [number]” format (for instance “+0100”). My current code is: which returns “GMT” in my location, which I assume is the short version (3 letters) of the timezones.