Online Java Compiler By
JavaTpoint.com
import java.util.Date; public class JavaDateSetMinutesExample1 { public static void main(String[] args) { Date d=new Date(); System.out.println("Old minute value is: "+d.getMinutes()); d.setMinutes(10); System.out.println("The Minute value after setting is: "+d.getMinutes()); } }
Output