How to convert date to string format in java?

2.88K viewsJava
0

I want to convert date to string format in java, please advice me.

 

Mounika Changed status to publish October 27, 2020
Add a Comment
0

Use the below snippet, it will work for your requirements.

 

SimpleDateFormat convertedDateFormat = new SimpleDateFormat(dateformat);//here pass the date format
String stringDate=convertedDateFormat.format(date); //here pass the input date

 

Manohar Changed status to publish June 25, 2019
Add a Comment
Write your answer.