Re: jbuilder and timestamps

From: Barry Lind <blind(at)xythos(dot)com>
To: miguel angel rojas aquino <mrojas_aquino(at)mail(dot)flashmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: jbuilder and timestamps
Date: 2002-11-04 17:45:41
Message-ID: 3DC6B245.1030004@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

What version of the driver are you using? I would suggest trying the
7.3beta3 driver as there have been some fixes in timestamp handling
since 7.2. You can get the latest driver from http://jdbc.postgresql.org

You really haven't provided enough information about the problem. What
you are reporting seems like the correct behavior. You have a value
stored in the database of 2002-09-19 00:00:00-05 (or 2002-09-19
05:00:00-00) and you are displaying that value in an application where
the timezone setting is -06, thus you end up seeing 2002-09-18
23:00:00-06 (of course your app is using a display format that doesn't
include the timezone so you really only see 2002-09-18 23:00:00)

So it seems to me that everything is behaving correctly.

thanks,
--Barry

miguel angel rojas aquino wrote:
> hi everybody, hope any one can give me some insigth about this one, we
> are in great despair :(
>
> we are developing an application using jbuilder 5 and postgresql
> 7.2.2-1PGDG, and found some strange beheavior with the timestamps, say
> for example, in our database we have a record like this one:
>
> id_emp | name | date
> --------+--------+------------------------
> 1004 | laura | 2002-09-19 00:00:00-05
>
> but when displaying this same date in a textfield in our application, it
> says the date is 2002-09-18 23:00:00!!!!
>
> the date field is a timestamp with time zone, we tried using a timestamp
> without time zone, but our app starts complaining about not finding a
> timestamp data type :(
>
> it gets worst as we need the right date to make some calculations about
> the number of days between dates.
>
> when querying this same database using SquirrelSQL (a java database
> client), the date apperas correctly as is in the database, so i think
> the problem is with the borland dataexpress components, but i'm not
> sure, so if somebody got the same problems, it would be greatly
> appreciated if can share the solution
>
> many thanks in advance, and best regards
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2002-11-04 17:49:18 Re: DatabaseMetaData.getTables() problem
Previous Message Andrew Sullivan 2002-11-04 17:24:06 Re: jbuilder and timestamps