How to convert date to string format in java?

3.03K 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
You are viewing 1 out of 1 answers, click here to view all answers.
Write your answer.