Change the first format to
SimpleDateFormat tempFormat = new SimpleDateFormat("yyyy-MM-dd");
as DD
is the day in the year. 22
is definitely in January
0
solved simple date format giving wrong month [duplicate]
Change the first format to
SimpleDateFormat tempFormat = new SimpleDateFormat("yyyy-MM-dd");
as DD
is the day in the year. 22
is definitely in January
0
solved simple date format giving wrong month [duplicate]