java calendar add minutes
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());
Also in Java:
- java loop object
- dataframe to dict without index
- thymeleaf Expression Object dialects
- how to add all list elements at once in java
- function in java
- create notification android
- one line if statement java
- how to break from a loop in java
- read int from keyboard java
- how to declare an array in java
- Java int to roman
- java singleton
- java how to convert string to int
- tostring() java example
- JOptionPane with drop down list java
- java constructor genertic
- java loop through string
- java stream find specific element
- java print treemap
- runtime java examples
- spring code in java
- check leap year in java
- how to make a list java
- open an existing excel file in java apache poi