Calendar.getTime() fails with java.lang.IllegalArgumentException:MINUTE for Asia/Singapore timezone
问题 Why is this code failing? The purpose was to remove the time part. String dateStr = "1982-01-01"; String timeZoneID = "Asia/Singapore"; DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date = dateFormat.parse(dateStr); Calendar calendar = Calendar.getInstance(); calendar.setTimeZone(TimeZone.getTimeZone(timeZoneID)); calendar.setLenient(false); calendar.setTime(date); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0);