Never try to be a hard-worker. Be a smart-worker.
My Blog
I don't see any code that retrieves dates from a DB, but the ResultSet.getDate method returns a Date object that can be formatted any way you want.
Never try to be a hard-worker. Be a smart-worker.
My Blog
Never try to be a hard-worker. Be a smart-worker.
My Blog
Then when you extract the date from the database, use a SimpleDateFormat object to convert it to a string in that format. That part of the question has nothing to do with the database at all.Originally posted by Rajkumar balakrishnan:
I want the date to be displayed as in dd-MM-yyyy format...
Jigar Naik
the da is the SQLDATE format
SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd/MM/yyyy");
d = DATE_FORMAT.parse(date);
date = DATE_FORMAT.format(d);
java.sql.Date da = java.sql.Date.valueOf(date);
Are you clear!!!
Is that meant to encourage me to help you? It achieves rather the opposite.
Never try to be a hard-worker. Be a smart-worker.
My Blog
Never try to be a hard-worker. Be a smart-worker.
My Blog