SimpleDateFormat format = new SimpleDateFormat("YYYY-MM-DD");
System.out.println("=============new Date() ="+new Date());
String dateStr =format.format(new Date() );
System.out.println("==============dateStr "+dateStr );
And see the below output
=============new Date() =Mon Feb 01 11:22:02 EST 2021
==============dateStr = 2021-02-32
What is wrong in this code which was working fine today it broke?