Hi, 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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:> Hi, > > 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 > -- > Posted via http://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thank u.... It worked... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---