When i call model_object.to_xml, there is a DateTime field and it’s
displayed as such: 2009-08-25T16:32:06Z
Is there anyway to modify the display format to say the format like
Time.now.utc?, i.e. 2009-09-09 03:14:20 UTC
thanks
When i call model_object.to_xml, there is a DateTime field and it’s
displayed as such: 2009-08-25T16:32:06Z
Is there anyway to modify the display format to say the format like
Time.now.utc?, i.e. 2009-09-09 03:14:20 UTC
thanks
Allen W. wrote:
When i call model_object.to_xml, there is a DateTime field and it’s
displayed as such: 2009-08-25T16:32:06ZIs there anyway to modify the display format to say the format like
Time.now.utc?, i.e. 2009-09-09 03:14:20 UTCthanks
Time formats in XML are standardized and Rails uses the standard. I
would highly recommend you NOT change it. The model layer should not be
responsible for date/time formats anyway. Let you views do their job.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs