ZonedDateTime getZone()
gets the time-zone, such as 'Europe/Paris'.
getZone
has the following syntax.
public ZoneId getZone()
The following example shows how to use getZone
.
import java.time.ZonedDateTime; public class Main { public static void main(String[] args) { ZonedDateTime dateTime =ZonedDateTime.now(); System.out.println(dateTime.getZone()); } }
The code above generates the following result.