OffsetTime adjustInto(Temporal temporal) example
Description
OffsetTime adjustInto(Temporal temporal)
adjusts the specified temporal
object to have the same offset and time as this object.
Syntax
adjustInto
has the following syntax.
public Temporal adjustInto(Temporal temporal)
Example
The following example shows how to use adjustInto
.
import java.time.OffsetTime;
import java.time.ZoneId;
import java.time.temporal.Temporal;
//w w w . ja v a 2 s. co m
public class Main {
public static void main(String[] args) {
OffsetTime m = OffsetTime.now();
Temporal n = m.adjustInto(OffsetTime.now(ZoneId.systemDefault()));
System.out.println(n);
}
}
The code above generates the following result.