Calendar.MINUTE has the following syntax.
public static final int MINUTE
In the following code shows how to use Calendar.MINUTE field.
import java.util.Calendar; //from www. j a v a2s .com public class Main { public static void main(String[] args) { Calendar now = Calendar.getInstance(); // add seconds to current date now.add(Calendar.SECOND, 500); System.out.println("adding 500 seconds : "); System.out.println(now.get(Calendar.MINUTE) + ":" + now.get(Calendar.SECOND)); // adding minus value now = Calendar.getInstance(); now.add(Calendar.SECOND, -500); System.out.println("adding -500 seconds: "); System.out.println(now.get(Calendar.MINUTE) + ":" + now.get(Calendar.SECOND)); } }
The output: