[TZInfo-users] strftime %Z
Thomas A. Moulton
tom at moulton.us
Sat Nov 17 01:31:17 UTC 2012
Ok I figured it out... helps to RTFM but I have to say examples help
dummies in a rush (me!)
otime = tz.strftime("%H:%M %Z", next_time)
tom
On 11/15/2012 10:12 PM, Thomas A. Moulton wrote:
> 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
> _______________________________________________
> TZInfo-users mailing list
> TZInfo-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/tzinfo-users
>
More information about the TZInfo-users
mailing list