LocalTime withSecond(int second)
returns a copy of this
LocalTime with the second-of-minute value altered.
withSecond
has the following syntax.
public LocalTime withSecond(int second)
The following example shows how to use withSecond
.
import java.time.LocalTime; public class Main { public static void main(String[] args) { LocalTime l = LocalTime.now(); LocalTime s = l.withSecond(1234); System.out.println(s); } }