Java examples for java.sql:Date
subtract day from java.sql.Date via LocalDate
//package com.java2s; import java.sql.Date; import java.time.LocalDate; public class Main { public static Date subtract(Date awal, int i) { LocalDate localDate = awal.toLocalDate(); LocalDate newDate = localDate.minusDays(i); return toDate(newDate); }/*from w ww. j a v a 2 s. c o m*/ public static Date toDate(LocalDate localDate) { return Date.valueOf(localDate); } }