Skip site navigation (1) Skip section navigation (2)

JDBC date problem

From: Aleksey Demakov <avd(at)gcom(dot)ru>
To: pgsql-interfaces(at)postgresql(dot)org, peter(at)retep(dot)org(dot)uk
Subject: JDBC date problem
Date: 1998-10-16 06:20:29
Message-ID: 87u315m3ip.fsf@avd.garsib.ru (view raw or flat)
Thread:
Lists: pgsql-interfaces
Can you believe me?

I have a table with a column which is to store the dates each row was
created. I fill it with the line:

    insert_stmt.setDate(2, new Date (System.currentTimeMillis ()));

And every day I insert a new row I can see that I did it tomorrow!

I have found that in the method PreparedStatement.setDate() the date
argument is intentionally incremented by one. The comments there say
that it's to compensate broken SimpleDateFormat. Apparently, my
SimpleDateFormat is ok (JDK 1.1.7 for win95/nt and jdk1.1.5 for freebsd).

Aleksey

-- 
Aleksey Demakov
avd(at)gcom(dot)ru

Responses

pgsql-interfaces by date

Next:From: Andrea AntiboDate: 1998-10-16 07:25:56
Subject: Re: [INTERFACES] applet
Previous:From: Roeland M.J. MeyerDate: 1998-10-15 20:56:53
Subject: LiveWire Javascript and PGSQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group