Forum: Ruby on Rails MySQL Datetime Format confusion

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.
9bdc0e85fa6e70ed8b040a1e3ed7050d?d=identicon&s=25 JesterXL (Guest)
on 2006-05-29 02:38
(Received via mailing list)
I have a column in a mysql table called "start_date" as a datetime.  I'm
returning the results from that table as XML.

render :xml => @mystuff.to_xml

However, instead of coming across like:

2006-05-28 00:00:00

It comes across in the XML instead as:

2006-05-28T02:00:00-04:00

Is there a way to make it match the mysql format, or another way to have
it
generate XML so the string matches the way mysql shows it?  Otherwise, I
can
parse the way Rails is sending it back, just curious why the format is
different.

???

--JesterXL
3dd4b52a0946bd698b1d1635a46ea3a3?d=identicon&s=25 François Beausoleil (fbeausoleil)
on 2006-05-29 02:51
(Received via mailing list)
Hi !

2006/5/28, JesterXL <jesterxl@jessewarden.com>:
> 2006-05-28 00:00:00
>
> It comes across in the XML instead as:
>
> 2006-05-28T02:00:00-04:00

This is the XML Schema date/time format:
http://www.w3.org/TR/xmlschema-2/#dateTime

Hope that helps !
This topic is locked and can not be replied to.