Problem converting time to date..


In my application in a @Schedule.begins_at object I have this value "Fri Feb 01 03:30:00 +0530 2008" In my view file i need this to be displayed as 3:30 AM But in my Schedules table begins_at field is datetime.. While creating i did like @schedule.begins_at = DateTime.Parse(@schedule.begins_at) During Edit i need the reverse of this i need "3:30 AM" form this time value "Fri Feb 01 03:30:00 +0530 2008" How to convert this..

Thanks in advance.. Ratnavel

I think it will work once you convert it to time object using ."to_time" helper method. though i have not tested it due to time constraints...

Ratnavel Sundaramurthi wrote: