SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); //startDate为String格式的日期 long startTime = format.parse(startDate).getTime();