Returns a copy of this ZonedDateTime with the zone ID set to the offset.
This returns a zoned date-time where the zone ID is the same as getOffset(). That means, with the returned instance, all region-based complex rules are not applicable anymore.
package com.logicbig.example.zoneddatetime;
import java.time.ZonedDateTime;
public class WithFixedOffsetZoneExample {
public static void main(String... args) {
ZonedDateTime d = ZonedDateTime.now();
System.out.println(d);
ZonedDateTime d2 = d.withFixedOffsetZone();
System.out.println(d2);
}
}
Output
2017-05-01T16:00:13.645-05:00[America/Chicago]
2017-05-01T16:00:13.645-05:00