add Years to LocalDateTime - Java java.time

Java examples for java.time:LocalDateTime

Description

add Years to LocalDateTime

Demo Code


//package com.java2s;

import java.time.LocalDateTime;

public class Main {
    public static LocalDateTime addYears(LocalDateTime inputDateTime,
            int yearsToAdd) {
        return inputDateTime.plusYears(yearsToAdd);
    }/*from   w  w  w .  j av a  2 s  .c  om*/
}

Related Tutorials