Re: [INTERFACES] Java and PGSQL date question

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: "Adam H(dot) Pendleton" <apendleton(at)vgsinc(dot)com>
Cc: pgsql-interfaces(at)hub(dot)org
Subject: Re: [INTERFACES] Java and PGSQL date question
Date: 1999-05-10 18:04:06
Message-ID: 37371F96.6A420D76@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

> I am trying to pass a date from Java into a PostgreSQL database. I am using
> the DateFormat.parse() funcitonality to format the date. However, the
> database doesn't want to take it? I looked at the PGSQL documentation and
> it says that the default date type is postgresql date type, which is: Wed
> Dec 17 07:37:16 1997 PST. Java is sending the date in this format: Wed Dec
> 17 07:37:16 PST 1997. How do I make this work. Is it easier to change the
> Java format or the PGSQL format?

postgres=> select 'Wed Dec 17 07:37:16 PST 1997'::datetime;
?column?
----------------------------
Wed Dec 17 15:37:16 1997 UTC
(1 row)

Looks good to me. Does this work from psql on your db? If so, then the
problem lies elsewhere...

- Tom

--
Thomas Lockhart lockhart(at)alumni(dot)caltech(dot)edu
South Pasadena, California

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Craig Orsinger 1999-05-10 18:32:59 RE: [INTERFACES] error insert
Previous Message Hannu Krosing 1999-05-10 17:21:57 Re: [INTERFACES] postgres -> ms sql7 odbc driver