I am working on Java. I have a date for example: 20120328.
Year is 2012, month is 03 & day is 28.
I want to convert it into yyyy-MM-dd format.
I have tried it but it is not working.
How to do it?
I am working on Java. I have a date for example: 20120328. Year is
Share
First you create the format using substring like
This produces the date as 2012-03-28
Then use simple date format to convert that into date if required.