# Is there any way to get the hour/minute value of a DateTime object?

**URL:** <https://www.ruby-forum.com/t/is-there-any-way-to-get-the-hour-minute-value-of-a-datetime-object/143945>\
**Category:** Rails\
**Created:** [July 24, 2008, 2:51am UTC](https://www.ruby-forum.com/t/is-there-any-way-to-get-the-hour-minute-value-of-a-datetime-object/143945 "2008-07-24T02:51:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![paradise](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/8e7dd6/32.png) [@paradise](https://www.ruby-forum.com/u/paradise)\
**Post date:** [July 24, 2008, 2:51am UTC](https://www.ruby-forum.com/t/is-there-any-way-to-get-the-hour-minute-value-of-a-datetime-object/143945/1 "2008-07-24T02:51:13Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![paradise](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/8e7dd6/32.png) [@paradise](https://www.ruby-forum.com/u/paradise)\
**Post date:** [July 24, 2008, 2:55am UTC](https://www.ruby-forum.com/t/is-there-any-way-to-get-the-hour-minute-value-of-a-datetime-object/143945/2 "2008-07-24T02:55:18Z")

</div>

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.
