You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Warren <wa...@clarksnutrition.com> on 2006/03/02 04:50:42 UTC

DB date field 8 hours ahead of Date property

I am having a problem inserting a date into a TIMESTAMP field. The field in
the database is exactly 8 hours ahead of the Date object I am inserting. My
insert statement is:

<insert id="insertScanOrder" parameterClass="scanOrder">
  INSERT INTO scanorder (clo1, col2, scn_date) values (#value1#, #value2#,
#scanOrderDate:TIMESTAMP#)
</insert>

I am using Ibatis version 2.0, PostgreSQL 7.4.6 with the postgres driver.

Thanks,

Warren Bell


Re: DB date field 8 hours ahead of Date property

Posted by Ed Griebel <ed...@gmail.com>.
You have a timezone problem. The date is being inserted in the GMT
timezone, but you are expecting it to be PST, 8 hrs behind. I'm not
familiar with PostgreSQL, maybe there's a default timezone setting or
default formatting that the postgres driver is doing.

-ed

On 3/1/06, Warren <wa...@clarksnutrition.com> wrote:
> I am having a problem inserting a date into a TIMESTAMP field. The field in
> the database is exactly 8 hours ahead of the Date object I am inserting. My
> insert statement is:
>
> <insert id="insertScanOrder" parameterClass="scanOrder">
>   INSERT INTO scanorder (clo1, col2, scn_date) values (#value1#, #value2#,
> #scanOrderDate:TIMESTAMP#)
> </insert>
>
> I am using Ibatis version 2.0, PostgreSQL 7.4.6 with the postgres driver.
>
> Thanks,
>
> Warren Bell
>
>


--
    "The greatest tyrannies are always perpetrated in the name of the
noblest causes." Thomas Paine
    "Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety" - Benjamin
Franklin