[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 
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?


More information about the TZInfo-users mailing list