# Weird weird DateTime object issue in rails 1.2.3

**URL:** <https://www.ruby-forum.com/t/weird-weird-datetime-object-issue-in-rails-1-2-3/147764>\
**Category:** Rails\
**Created:** [September 5, 2008, 7:19am UTC](https://www.ruby-forum.com/t/weird-weird-datetime-object-issue-in-rails-1-2-3/147764 "2008-09-05T07:19:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chirantan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/eb9ed0/32.png) [@chirantan](https://www.ruby-forum.com/u/chirantan)\
**Post date:** [September 5, 2008, 7:19am UTC](https://www.ruby-forum.com/t/weird-weird-datetime-object-issue-in-rails-1-2-3/147764/1 "2008-09-05T07:19:23Z")

</div>

Hi,

For some reason, I need to work on Rails 1.2.3. I need to add hours  
and mins to a particular DateTime Object.

I wrote the code on my machine using just Ruby (1.8.6)

puts DateTime.new(1900) —\> 1900-01-01T00:00:00+00:00  
puts DateTime.new(1900) + 30 —\> 1900-01-31T00:00:00+00:00

The code seemed to have worked!

However, when I write the exact same code in my rails environment, for  
some odd reason, the year field appears to be ‘0000’ instead of  
‘1900’.

I wonder what is going wrong. May be conflicting Date, DateTime  
libraries.

Any pointers on this?
