I am having trouble formatting date in java.
I have a shopping class that has item name in string, quantity in int and a date in Date.
In the run class I am trying to run this query.
Date date = new Date(202020);
SimpleDateFormat dateformat = new SimpleDateFormat("dd-mm-yy");
String date1 = dateformat.format(date);
Shopping shoplist1 = new Shopping ( "iphone", 2, date);
When I try to create a new shopping entery with the date the date does not format. I don't know why but it gives me Thu Jan 01 01:03:22 GMT 1970.