Forum: Ruby Printing RFC3339 timezone?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
81194a50c0f9bd95d7832a77fdf371bd?d=identicon&s=25 csn (Guest)
on 2006-01-25 01:43
How can I print a valid RFC3339 time zone (used by Atom)? Presumably
using strftime; which outputs -HHMM for "%z" (which isn't documented),
but RFC3339 requires -HH:MM (I know RFC3339 allows 'Z', but I'd like the
actual time zone).

thanks
csn
123320fdc17940dfc8e365edb48fbff2?d=identicon&s=25 Bob Showalter (Guest)
on 2006-01-25 15:13
(Received via mailing list)
csn wrote:
> How can I print a valid RFC3339 time zone (used by Atom)? Presumably
> using strftime; which outputs -HHMM for "%z" (which isn't documented),
> but RFC3339 requires -HH:MM (I know RFC3339 allows 'Z', but I'd like the
> actual time zone).

Take a look at:

http://www.ruby-doc.org/stdlib/libdoc/time/rdoc/cl...
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 Austin Ziegler (Guest)
on 2006-01-25 15:13
(Received via mailing list)
On 24/01/06, csn <cool_screen_name90001@yahoo.com> wrote:
> How can I print a valid RFC3339 time zone (used by Atom)? Presumably
> using strftime; which outputs -HHMM for "%z" (which isn't documented),
> but RFC3339 requires -HH:MM (I know RFC3339 allows 'Z', but I'd like the
> actual time zone).

Try using Time#xmlschema.

-austin
This topic is locked and can not be replied to.