LocalTime withMinute(int minute) example
Description
LocalTime withMinute(int minute)
returns a copy of this LocalTime
with the minute-of-hour value altered.
Syntax
withMinute
has the following syntax.
public LocalTime withMinute(int minute)
Example
The following example shows how to use withMinute
.
import java.time.LocalTime;
/* w ww. j a va 2 s . c o m*/
public class Main {
public static void main(String[] args) {
LocalTime l = LocalTime.now();
LocalTime s = l.withMinute(34);
System.out.println(s);
}
}
The code above generates the following result.