I'm retrieving data from database in ruby on rails.I have to update the Date retrieved with a new formatted date in controller.
Something like this one:-
@events = 'My Query.'
@events.each do |eventdata|
# Since the date is in utc i have to convert it in users time zone.
eventdata.start_date = eventdata.start_date.strftime("%Y-%m-%d %H:%M:%S")
end
But its not working. Need some help on this.