Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to add minutes in date in java

// 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);
 
PREVIOUS NEXT
Tagged: #add #minutes #date #java
ADD COMMENT
Topic
Name
9+6 =