# Oracle date, i get 0007 instead of 2007

**URL:** <https://www.ruby-forum.com/t/oracle-date-i-get-0007-instead-of-2007/115059>\
**Category:** Rails\
**Created:** [September 20, 2007, 8:19am UTC](https://www.ruby-forum.com/t/oracle-date-i-get-0007-instead-of-2007/115059 "2007-09-20T08:19:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexmic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/977dab/32.png) [@alexmic](https://www.ruby-forum.com/u/alexmic)\
**Post date:** [September 20, 2007, 8:19am UTC](https://www.ruby-forum.com/t/oracle-date-i-get-0007-instead-of-2007/115059/1 "2007-09-20T08:19:41Z")

</div>

I’m running Oracle and in my table i have a field:  
SCHEDULED\_DATE of type DATE.

When I do a query model = MyModel.find(1)  
model.scheduled\_date\_before\_type\_case ends up being equal to  
‘0007-09-19’ instead of ‘2007-09-19’.

In the oracle adapter I ran a debug accross all the fields and got, just  
after it does the query and gets the results.

- 0001017408770802
- 0001017408
- “770802”
- !ruby/object:OraDate 0007/09/19 00:00:00
- !ruby/object:OraDate 0007/09/19 00:00:00
- N
- !ruby/object:OraDate 0007/09/19 00:00:00
- RM

Any ideas?

---

<div class="post-metadata">

**Author:** ![alexmic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/977dab/32.png) [@alexmic](https://www.ruby-forum.com/u/alexmic)\
**Post date:** [September 21, 2007, 1:17am UTC](https://www.ruby-forum.com/t/oracle-date-i-get-0007-instead-of-2007/115059/2 "2007-09-21T01:17:35Z")

</div>

Any hints at how I could debug this would really be appreciated?

---

<div class="post-metadata">

**Author:** ![alexmic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/977dab/32.png) [@alexmic](https://www.ruby-forum.com/u/alexmic)\
**Post date:** [September 21, 2007, 5:18am UTC](https://www.ruby-forum.com/t/oracle-date-i-get-0007-instead-of-2007/115059/3 "2007-09-21T05:18:35Z")

</div>

In my opinion Rails does some weird parsing of strings into dates. I  
wrote a  
plugin that changes how dates are parsed that makes it much more sane,  
at  
least in my opinion.

[http://svn.viney.net.nz/things/rails/plugins/validates\_date\_time](http://svn.viney.net.nz/things/rails/plugins/validates_date_time)
