OffsetTime adjustInto(Temporal temporal)
adjusts the specified temporal
object to have the same offset and 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.OffsetTime; import java.time.ZoneId; import java.time.temporal.Temporal; //from w w w. ja va 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.