Dear friends,
I have the problem with date format. I receiving the date with the
format dd/mm/yyyy. But I can upload to MySQL only in the format of
yyyy-mm-dd.
how should I handle this situation, for this I've created these code
lines.But I have some problem with these line. please help me to solve
this problem.
rs.getString("DATA_SCAD1")// where the source from .xls files
String pattern = "yyyy-MM-dd";
SimpleDateFormat format = new SimpleDateFormat(pattern);
try {
Date date = format.parse("DATA_SCAD1");
System.out.println(date);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(format.format(new Date()));
this out put gives me Tue Apr 03 00:00:00 IST 2007
But I need the date format in yyyy-mm-dd.
regards,
maza
thanks in advance.
M
maza
@maza
0
Reputation
1
Posts
28
Profile views
0
Followers
0
Following
Best posts made by maza
This user hasn't posted anything yet.
Latest posts made by maza
-
Problem to convert dd/mm/yyyy to yyyy-mm-dd in JAVA. Please help me.