java.time.LocalDateTime.plus() Method Example


java.time.LocalDateTime.plus() Method Example

package com.codingdict;

import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;

public class LocalDateTimeDemo {
   public static void main(String[] args) {

      LocalDateTime date = LocalDateTime.parse("2017-02-03T10:15:30");
      LocalDateTime date1 = date.plus(10, ChronoUnit.DAYS);
      System.out.println(date1);  
   }
}