[TZInfo-users] strftime %Z
Thomas A. Moulton
tom at moulton.us
Fri Nov 16 03:12:26 UTC 2012
How can I use strftime to display a time in the format "20:45 EDT"
I looked at
http://tzinfo.rubyforge.org/doc/classes/TZInfo/Timezone.html#M000060
and think that "%H:%M %Z" would do it, but no joy.
now = DateTime.now.new_offset(0)
ltime = tz.utc_to_local(now)
otime = ltime.strftime("%H:%M %Z")
returns "14:07 +00:00"
Can anyone provide an example for me?
Tom
More information about the TZInfo-users
mailing list