Java SQL LocalDate add(Date awal, int i)

Here you can find the source of add(Date awal, int i)

Description

add

License

Apache License

Declaration

public static Date add(Date awal, int i) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.sql.Date;

import java.time.LocalDate;

public class Main {
    public static Date add(Date awal, int i) {
        LocalDate localDate = awal.toLocalDate();

        LocalDate newDate = localDate.plusDays(i);

        return toDate(newDate);
    }//from   w w  w.  ja  va 2s .  co m

    public static Date toDate(LocalDate localDate) {
        return Date.valueOf(localDate);
    }
}

Related

  1. addDays(final Date date, final int daysToAdd)
  2. asLocalDate(Date date)
  3. asLocalDate(Date date)
  4. asLocalDate(java.util.Date date, ZoneId zone)