code: public static Calendar getCalendar(String time, char sep, boolean isStart) {
  		Calendar cal = Calendar.getInstance();
  
  		cal.set(Calendar.HOUR_OF_DAY, isStart ? 0 : 23);
  		cal.set(Calendar.MINUTE, isStart ? 0 : 59);
  		cal.set(Calendar.SECOND, isStart ? 0 : 59);
  		cal.set(Calendar.MILLISECOND, isStart ? 0 : 999);
  
  		try {
  			int idx = time.indexOf(sep);
  
  			if (idx != -1) {
  				cal.set(Calendar.YEAR, Integer.parseInt(time.substring(0, idx)));
  				time = time.substring(idx + 1);
  				idx = time.indexOf(sep);
  				if (idx != -1) {
  					cal.set(Calendar.MONTH,
  							Integer.parseInt(time.substring(0, idx)) - 1);
  					cal.set(Calendar.DAY_OF_MONTH,
  							Integer.parseInt(time.substring(idx + 1)));
  				}
  			}
  		} catch (Exception e) {
  			e.printStackTrace();
  		}
  
  		return cal;
  	}
docs: 将以yyyy-MM-dd形式的字符串转换为Calendar对象
  
  @param time
  时间字符串
  @param sep
  分隔符号
  @param isStart
  为true表示时、分、秒、毫秒都取0，为false表示取最后一刻