pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Aleksey Demakov <avd@gcom.ru>
To: pgsql-interfaces@postgresql.org
To: peter@retep.org.uk
Subject: JDBC date problem
Date: 16 Oct 1998 13:20:29 +0700
Message-ID: <87u315m3ip.fsf@avd.garsib.ru> (raw)


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@gcom.ru



view thread (12+ messages)  latest in thread

Message-ID: <87u315m3ip.fsf@avd.garsib.ru>
Permalink:  ../87u315m3ip.fsf@avd.garsib.ru/
Also on:    postgresql.org/message-id/87u315m3ip.fsf@avd.garsib.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: avd@gcom.ru, peter@retep.org.uk
  Subject: Re: JDBC date problem
  In-Reply-To: <87u315m3ip.fsf@avd.garsib.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox