Java LocalTime getMinute() Method
Example
Get the minute of a time:
import java.time.LocalTime;
public class Main {
public static void main(String[] args) {
LocalTime myTime = LocalTime.of(14, 30);
System.out.println(myTime.getMinute());
}
}
Definition and Usage
The getMinute() method returns the minute of the time, as a number from 0 to 59.
Tip: Use the getHour() method to get the hour.
Syntax
public int getMinute()
Parameter Values
None.
Technical Details
| Returns: | The minute, from 0 to 59. |
|---|
Related Pages
❮ Date and Time Methods