Dave Lynam
2008-Jul-24 00:50 UTC
Is there any way to get the hour/minute value of a DateTime object?
This may be a stupid question, but I have been exploring the methods of DateTime and Time and am unable to find anything that extracts just the minute or the hour. Am I going to have to write my own functions to do this? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Dave Lynam
2008-Jul-24 00:54 UTC
Re: Is there any way to get the hour/minute value of a DateTime object?
Nevermind I just figured it out by creating a DateTime object: d = DateTime.new and then exploring all of its methods: d.methods the method for minute is min, i was using minute. hour is just hour. On Jul 23, 5:50 pm, Dave Lynam <dly...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> This may be a stupid question, but I have been exploring the methods > of DateTime and Time and am unable to find anything that extracts just > the minute or the hour. Am I going to have to write my own functions > to do this?--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---