ZoneOffset ofHours(int hours)
creates an instance of ZoneOffset using an offset in hours.
ofHours
has the following syntax.
public static ZoneOffset ofHours(int hours)
The following example shows how to use ofHours
.
import java.time.ZoneOffset; public class Main { public static void main(String[] args) { ZoneOffset t = ZoneOffset.ofHours(1); System.out.println(t); } }
The code above generates the following result.