Home » Java Date setMinutes() Method with Examples

Java Date setMinutes() Method with Examples

by Online Tutorials Library

Java Date setMinutes() Method

The setMinutes() method of Java Date class sets the minutes of the hour of this date object to the given value. It changes the previous minutes of the hour value to the newly specified value.

This method is deprecated as of JDK version 1.1 and replaced by Calendar.set(Calendar.MINUTE, int minutes).

Syntax:

Parameters

The parameter ‘minutes’ represents the minute value between 0-59.

Return

NA

Example

Test it Now

Output:

Old minute value is: 56  The Minute value after setting is: 10  

Next TopicJava Util Date

You may also like