package com.xxfc.platform.vehicle.util;

import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Date;

/**
 * @author libin
 * @version 1.0
 * @description
 * @data 2019/10/23 10:52
 */
public class DateUtils {

    public static LocalDate dateToLocalDate(Date date) {
        return LocalDate.from(date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
    }

    public static Date localDateToDate(LocalDate localDate) {
        return Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
    }
}
