Code example for TimeZone

Methods: getOffset

0
    public float getOffset() { 
        long now = System.currentTimeMillis();
        if (timeZone == null) {
            timeZone = TimeZone.getTimeZone(timeZoneID);
        } 
        return timeZone.getOffset(now) / 3600000.0f;
    } 
     
    /** 
     * Compares this city to another by name. 
     */ 
    public int compareTo(City o) {
        return name.compareTo(o.name);
    } 
} 
Experience pair programming with AI  Get Codota for Java