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.
csn (Guest)
on 2006-01-25 02: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
Bob S. (Guest)
on 2006-01-25 16: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...
Austin Z. (Guest)
on 2006-01-25 16:13
(Received via mailing list)
On 24/01/06, csn <removed_email_address@domain.invalid> 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.