Java Date changing format [duplicate]
问题 This question already has answers here : java.util.Date format conversion yyyy-mm-dd to mm-dd-yyyy (6 answers) Closed 2 years ago . I am trying to change the format of Date objects, I am trying to do it in this way: for(Date date : dates){ DateFormat formatter = new SimpleDateFormat("yyyy/MM/dd"); String formatterDate = formatter.format(date); Date d = formatter.parse(formatter.format(date)); } But this does not have any effect on the d object, it is still with the old format, can't really