📜  如何在java代码示例中添加日期分钟数

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

代码示例1
// Adding 10 mins using Date constructor.
Calendar date = Calendar.getInstance();
System.out.println("Current Date and TIme : " + date.getTime());
long timeInSecs = date.getTimeInMillis();
Date afterAdding10Mins = new Date(timeInSecs + (10 * 60 * 1000));
System.out.println("After adding 10 mins : " + afterAdding10Mins);