📜  java 日历添加分钟 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:34.393000             🧑  作者: Mango

代码示例1
String myTime = "14:10";
 SimpleDateFormat df = new SimpleDateFormat("HH:mm");
 Date d = df.parse(myTime); 
 Calendar cal = Calendar.getInstance();
 cal.setTime(d);
 cal.add(Calendar.MINUTE, 10);
 String newTime = df.format(cal.getTime());