LocalTime with(TemporalAdjuster adjuster)
returns an adjusted copy of this time.
with
has the following syntax.
public LocalTime with(TemporalAdjuster adjuster)
The following example shows how to use with
.
import java.time.LocalTime; public class Main { public static void main(String[] args) { LocalTime l = LocalTime.now(); LocalTime s = l.with(LocalTime.NOON); System.out.println(s); } }
The code above generates the following result.