Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Date now = new Date();
- Map<String, String> myDate = new LinkedHashMap<String, String>();
- auctionDate.put("", "All");
- SimpleDateFormat sdfDDMMYYYYEEE = new SimpleDateFormat("dd/MM/yyyy (EEE)");
- SimpleDateFormat sdfDDMMYYYY = new SimpleDateFormat("dd/MM/yyyy");
- SimpleDateFormat sdfEEE = new SimpleDateFormat("EEE");
- for (int i = 0; i < 5; i++) {
- if (sdfEEE.format(now).equals("Sun")) {
- now.setTime(now.getTime() + 86400000);
- i--;
- continue;
- }
- myDate.put(sdfDDMMYYYY.format(now), sdfDDMMYYYYEEE.format(now));
- now.setTime(now.getTime() + 86400000);
- }
- System.out.println(myDate);
- {=All, 07/07/2015=07/07/2015 (Tue), 08/07/2015=08/07/2015 (Wed), 09/07/2015=09/07/2015 (Thu), 10/07/2015=10/07/2015 (Fri), 11/07/2015=11/07/2015 (Sat)}
- ["":"All", "07/07/2015" : "07/07/2015 (Tue)", "08/07/2015" : "08/07/2015 (Wed)", "09/07/2015" : "09/07/2015 (Thu)", "10/07/2015" : "10/07/2015 (Fri)", "11/07/2015" : "11/07/2015 (Sat)"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement