SHARE
TWEET

Untitled

a guest Mar 29th, 2017 42 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var today = new Packages.java.time.LocalDate.now();
  2. logger.warn("Today: " + today);
  3.  
  4. var ChronoUnit = Packages.java.time.temporal.ChronoUnit;
  5. var Instant = Packages.java.time.Instant;
  6. var ZoneId = Packages.java.time.ZoneId;
  7.  
  8. var fiveDaysAfterToday = today.plus(5, ChronoUnit.DAYS);
  9. logger.warn("New Date: " + fiveDaysAfterToday);
  10.  
  11. var instant = fiveDaysAfterToday.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant();
  12. var dueDate  = new Packages.java.util.Date.from(instant);
  13. logger.warn("Due date: " + dueDate);
RAW Paste Data
Top