Here you can find the source of hasZone(TemporalAccessor date)
public static boolean hasZone(TemporalAccessor date)
//package com.java2s; /*!//from w w w.ja v a 2 s .c o m * mifmi-commons4j * https://github.com/mifmi/mifmi-commons4j * * Copyright (c) 2015 mifmi.org and other contributors * Released under the MIT license * https://opensource.org/licenses/MIT */ import java.time.OffsetDateTime; import java.time.OffsetTime; import java.time.ZonedDateTime; import java.time.temporal.TemporalAccessor; public class Main { public static boolean hasZone(TemporalAccessor date) { if (date == null) { return false; } if (date instanceof ZonedDateTime) { return true; } else if (date instanceof OffsetDateTime) { return true; } else if (date instanceof OffsetTime) { return true; } return false; } }