String formatsTimeZone(TimeZone tz) {
        // package-private for test.
        int seconds = Math.abs(tz.getOffset(System.currentTimeMillis())) / 1000;
        int hours = seconds / 3600;
        int minutes = (seconds % 3600) / 60;
        return (tz.getRawOffset() < 0 ? "-" : "+") + String.format("%02d:%02d", hours, minutes);
    }
Formats a {@link TimeZone} as specified in XEP-0082: XMPP Date and Time Profiles.

@param tz The time zone.
@return The formatted time zone.
xmppserver/src/main/java/org/jivesoftware/openfire/handler/IQEntityTimeHandler.java