2 digit year resolves to 1st century rather than 20th when using postgres 
timestamp with timezone + activerecord-jdbcpostgresql-adapter
---------------------------------------------------------------------------------------------------------------------------------------

                 Key: JRUBY-2465
                 URL: http://jira.codehaus.org/browse/JRUBY-2465
             Project: JRuby
          Issue Type: Bug
          Components: ActiveRecord-JDBC
         Environment: jruby 1.1.1 (and 1.1)
RoR 2.0.2
activerecord-jdbcpostgresql-adapter 0.8
attachment_fu vendor plugin
jruby-openssql 0.2.2
windows xp pro
postgresql 8.2

            Reporter: Jin Lee


Hi - 

When a user inputs a date using a 2 digit year, jruby (and/or 
activerecord-jdbcpostgresql-adapter) inserts a 1st century year into the 
database. For example:

ex) 04/28/08 <-- user input

in the controller: 
db_insert = SomeActiveRecordModel.new(:the_date => params[:some_date])
db_insert.save

In the database, it is saved as:
0008-04-28

In native ruby, this same situation resolves to 20th century years - 2008

I've verified this behavior for timestamp with timezone and date data types

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to