[Solved] SimpleDateFormat returning null but can print date on screen


You are declaring a second variable named date in your try body. Remove the Date portion (which makes it local). Change

Date date = format.parse(sDate);

to

date = format.parse(sDate);

2

solved SimpleDateFormat returning null but can print date on screen