import java.text.SimpleDateFormat;import java.util.Date; /** Created by ${ligh} on 2019/7/2 下午4:06/public class DateUtil {/* String类型的时间转换成Date类型的时间@param date @return */public static Date stringToDate(String date){Date parse = null;try{SimpleDateFormat format = new SimpleDateFormat(“yyyy-MM-dd”);parse = format.parse(date);}catch (Exception e){e.printStackTrace();}return parse;} /** 计算输入时间与当前时间差多少分钟@param date @return /public static long timeDuringM(Date date) {Long timestrap = date.getTime() - System.currentTimeMillis();return timestrap / (1000 60);} }