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.
JesterXL (Guest)
on 2006-05-29 04: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
François B. (Guest)
on 2006-05-29 04:51
(Received via mailing list)
Hi !

2006/5/28, JesterXL <removed_email_address@domain.invalid>:
> 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.