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

[ad_1]

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

[ad_2]

solved SimpleDateFormat returning null but can print date on screen