C
curwen
Hi all,
I have a unix timestamp (1074074051) to be converted and inserted in a
database.
I tried the following:
Date d = new Date(Long.parseLong(1074074051) * 1000 );
String strSQL ="INSERT INTO MYTABLE values ("+
",to_date("+d.toString()+")"+ etc...
and the result was:
1) if I use java.sql.date:
it converts only yyyy-mm-dd but I need the seconds, to
is there a way to retrieve the secs,too?
2) if I use java.sql.date:
I get a date like:
'Wed Jan 14 10:54:11 GMT+01:00 2004'
I can't find a suitable Oracle format mask for it
plus: I'm living in the GMT+1 zone, so I guess the JVM takes the GMT
from my system
the situation is: the timestamp is in GMT0 time and Java convert in
+1, correct?
so is easier for me store the gmt+1 local time in db
what the correct format mask OR the java manipulation to get an
insertable date string?
3) what's your opinion about my approach?
thanks in advance
jc
I have a unix timestamp (1074074051) to be converted and inserted in a
database.
I tried the following:
Date d = new Date(Long.parseLong(1074074051) * 1000 );
String strSQL ="INSERT INTO MYTABLE values ("+
",to_date("+d.toString()+")"+ etc...
and the result was:
1) if I use java.sql.date:
it converts only yyyy-mm-dd but I need the seconds, to
is there a way to retrieve the secs,too?
2) if I use java.sql.date:
I get a date like:
'Wed Jan 14 10:54:11 GMT+01:00 2004'
I can't find a suitable Oracle format mask for it
plus: I'm living in the GMT+1 zone, so I guess the JVM takes the GMT
from my system
the situation is: the timestamp is in GMT0 time and Java convert in
+1, correct?
so is easier for me store the gmt+1 local time in db
what the correct format mask OR the java manipulation to get an
insertable date string?
3) what's your opinion about my approach?
thanks in advance
jc