# Extending a class changes from 1.8.4 to 1.8.6

**URL:** <https://www.ruby-forum.com/t/extending-a-class-changes-from-1-8-4-to-1-8-6/150277>\
**Category:** Ruby\
**Created:** [October 6, 2008, 9:10pm UTC](https://www.ruby-forum.com/t/extending-a-class-changes-from-1-8-4-to-1-8-6/150277 "2008-10-06T21:10:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [October 6, 2008, 9:10pm UTC](https://www.ruby-forum.com/t/extending-a-class-changes-from-1-8-4-to-1-8-6/150277/1 "2008-10-06T21:10:11Z")

</div>

require ‘date’  
class MyDateTime \< DateTime end

under ruby 1.8.4:  
MyDateTime.now.class -\> MyDateTime

under ruby 1.8.6  
MyDateTime.now.class -\> DateTime

I feel like I missed the boat on something obvious here. I googled  
around a bit though and didn’t see anything and I have a mission  
critical issue that I need to resolve.

Thanks in advance!  
Tim

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [October 6, 2008, 9:17pm UTC](https://www.ruby-forum.com/t/extending-a-class-changes-from-1-8-4-to-1-8-6/150277/2 "2008-10-06T21:17:14Z")

</div>

Tim McIntyre wrote:

> require ‘date’  
> class MyDateTime \< DateTime end
> 
> under ruby 1.8.4:  
> MyDateTime.now.class -\> MyDateTime
> 
> under ruby 1.8.6  
> MyDateTime.now.class -\> DateTime
> 
> I feel like I missed the boat on something obvious here. I googled  
> around a bit though and didn’t see anything and I have a mission  
> critical issue that I need to resolve.
> 
> Thanks in advance!  
> Tim

I suppose I should actually ask a question with that:-)

What do I need to do to get the 1.8.4 behavior in 1.8.6?

Thanks!  
Tim

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [October 6, 2008, 9:25pm UTC](https://www.ruby-forum.com/t/extending-a-class-changes-from-1-8-4-to-1-8-6/150277/3 "2008-10-06T21:25:10Z")

</div>

On Mon, Oct 6, 2008 at 21:15, Tim McIntyre [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > 
> 
> Thanks!  
> Tim

I suggest looking at lib/date.rb, particularly at Date.now and  
Time.now.to\_datetime. The rest might depend on your usage.
