Recently, I have imported CSV file to MongoDB with the date field. The issue is with the date field, I try to change the date field from string to ISO format. currently, it show "2016-07-31T04:18:17.000Z". I don't know how to change this into ISO format using java. I tried this method
String date1 = dr1.getString("created_at");
DateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy");
Date Created_at = df.parse(date1);
dr1.append("created_at", Created_at);
Brand_Mention(dr1,collection1,new ObjectId(dr1.get("_id").toString()));
Could anyone please help me to solve this!!!