Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> using TIMESTAMP with Java

using TIMESTAMP with Java

From: Axel Seinsche <newsgroup_at_seinsche.net>
Date: Thu, 20 Feb 2003 15:26:09 +0100
Message-ID: <b32ogt$kmd$04$1@news.t-online.com>


Hi NG,

I'm using an Oracle 9i Rel. 2 DB with a TIMESTAMP field. How do I save a time value with milliseconds via JDBC.

As you can see below I use curentTimeMillis() to get my current date / time. The System.out.println shows the correct value! The time contains the milliseconds. But in my DB there are still no milliseconds to see.

Any ideas?

Axel

long currentDate = System.currentTimeMillis(); System.out.println("My date: " + new
java.text.SimpleDateFormat("dd/MM/yyyy HH:mm:s:SSS").format(new Date(currentDate)));

System.out.println("SQL date: " + new Timestamp(currentDate).toString()); Received on Thu Feb 20 2003 - 08:26:09 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US