wrong value when converting String date to date Object
When I convert String date like "18/09/13,02:01:51" Using this method:
public static Date stringToDateFormat(String dateString) {
Date date = null;
try {
date = new SimpleDateFormat("dd/MM/yy,hh:mm:ss").parse(dateString);
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
When I save this convert this date object to SQL Date and store it in
PostgreSQL Database, I lose the time 2013-09-18 00:00:00
Is it coding problem or DB configuration?
Thanks.
No comments:
Post a Comment