Hi,
I've inserted a timestamp into a datetime
column. What I noticed is that the minute field remains at 01 regardless
of the actual time. So if I insert a timestamp such as "2001-01-12
15:50:35.118", I will get "2001-01-12 15:01:35.118" from a simple select.
I tried running "SELECT TO_DATE(date_COL, "hh:nn:ss dd:mm:yyyy")" and it did
return correctly as "15:50:35 12:01:2001". My property file has
dateTimeFormat set to "yyyy-mm-dd hh:mm:ss.lll". Any idea what's wrong? See below for code
to how I insert the datetime value.
java.util.Date
uDate = new java.util.Date();
myStatement =
c.createStatement(); myStatement.execute("drop table
t1"); myStatement.execute("create table t1 (date1 DATETIME
NULL)")
myStatement.execute("insert into t1 (date1)
values (\"" + new Timestamp(uDate.getTime()) + "\")");
Thanks,
Wilfred
|