How to convert date to string format in java?

3.75K viewsJava

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


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

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.