Hello Friends,
I want to store date in my DB table as dd-MM-yyyy HH:mm:ss.
Basically I want date and time also.
I used -
Java.sql.Date date = new Java.sql.Date(System.currentTimeMillis());
It is giving me date value in DB table field but not time..
what do I need to do for it?
1. I checked SimpleDateFormat. It does do the formatting but gives back
String, I want a formatted Date object
2. Also, I checked to use java.sql.Timestamp - however it gives values till nano seconds, I want it till seconds only.
How do I get this?
Thank you in advance!
Regards,
Leena