Nick ONeill Nick ONeill - 1 year ago 67
Ruby Question

How do you get the local timezone offset in "+hh:mm" format?

I know how to get the current utc_offset using

but how can I get it in the format "+hh:mm"?

The best solution I have so far is[-6,6]

Answer Source

strftime with %z (: means hour and minute offset from UTC with a colon):

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download