Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Kaustubh Katdare

    @thebigk • Oct 4, 2018

    I think Java has a Calendar class which you can use to add dates to any date. Here's the official documentation: <a href="https://docs.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html" target="_blank" rel="noopener noreferrer">Calendar (Java 2 Platform SE 5.0)</a>

    Date dt = new Date(); Calendar c = Calendar.getInstance(); c.setTime(dt); c.add(Calendar.DATE, 1); dt = c.getTime();

    in Java 8, you may do something like -

    LocalDateTime.from(dt.toInstant()).plusDays(1);

    Replace "1" with the number of days you wish to add. I'm not a Java expert. I think #-Link-Snipped-# might help. He knows Java stuff.Â