Calendar now = Calendar.getInstance();
System.out.println("Date and Time: "+now.get(Calendar.YEAR)+"-"
+now.get(Calendar.MONTH)+"-"
+now.get(Calendar.DAY_OF_MONTH)+" "
+ now.get(Calendar.HOUR_OF_DAY)
+ ":"
+ now.get(Calendar.MINUTE));
It gives Output >>Date and Time : 2016-7-8 16:10
But I want >>Date and Time : 2016-8-8 16:10
Means it gives the day of month wrong,then how to rewrite above code for correct output.