I have a DATE datatype mysql column in a table. I want to set the value of that column from my java code in the format YYYY-MM-DD
I used following code to test these formats..
Calendar c = Calendar.getInstance();
c.setTime(new Date());
String d = c.YEAR+ "-"+c.MONTH+"-"+c.DATE;
But I get some wierd output if i print out that value in console. Please help. How else can I accomplish this ?