I want to change a string returned from the following format to a date that shows how many months days since the last order was placed from a customer, I have the following code on the page to get the result -
<% @lastorder = Order.select("DateCreated").where("customer_id == ?", customer.id).order("Datecreated desc").find(:all, :limit => 1) %>
but this then returns the following format -
[#<Order DateCreated: "2013-01-09 00:00:00">]
There is probably a better way to do this but I am unaware of it at the moment.