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