ZonedDateTime withFixedOffsetZone()
returns a copy of this date-time with the zone ID set to the offset.
withFixedOffsetZone
has the following syntax.
public ZonedDateTime withFixedOffsetZone()
The following example shows how to use withFixedOffsetZone
.
import java.time.ZonedDateTime; public class Main { public static void main(String[] args) { ZonedDateTime dateTime =ZonedDateTime.now(); ZonedDateTime l =dateTime.withFixedOffsetZone() ; System.out.println(l); } }
The code above generates the following result.