I have a requirement to convert the input date string format "20130212" (YYYYMMDD) to 12/02/2013 (DD / MM / YYYY)
using ThreadLocal . I know a way to do this without ThreadLocal . Can anybody help me?
Conversion without ThreadLocal :
final SimpleDateFormat format2 = new SimpleDateFormat("MM/dd/yyyy"); final SimpleDateFormat format1 = new SimpleDateFormat("yyyyMMdd"); final Date date = format1.parse(tradeDate); final Date formattedDate = format2.parse(format2.format(date));
java date-conversion simpledateformat
user2680017
source share