LocalTime adjustInto(Temporal temporal)
adjusts the
specified temporal object to have the same time as this object.
adjustInto
has the following syntax.
public Temporal adjustInto(Temporal temporal)
The following example shows how to use adjustInto
.
import java.time.LocalTime; import java.time.temporal.Temporal; //www . j ava 2 s.c o m public class Main { public static void main(String[] args) { LocalTime l = LocalTime.now(); LocalTime t = LocalTime.NOON; Temporal s = l.adjustInto(t); System.out.println(s); } }
The code above generates the following result.