private static Date parseLDAPDate(String dateText) {
        // If the date ends with a "Z", that means that it's in the UTC time zone. Otherwise,
        // Use the default time zone.
        boolean useUTC = false;
        if (dateText.endsWith("Z")) {
            useUTC = true;
        }
        Date date = new Date();
        try {
            if (useUTC) {
                ldapDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
            }
            else {
                ldapDateFormat.setTimeZone(TimeZone.getDefault());
            }
            date = ldapDateFormat.parse(dateText);
        }
        catch (Exception e) {
            LoggerFactory.getLogger(LdapUserProvider.class).error(e.getMessage(), e);
        }
        return date;
    }
Parses dates/time stamps stored in LDAP. Some possible values:

<ul>
     <li>20020228150820</li>
     <li>20030228150820Z</li>
     <li>20050228150820.12</li>
     <li>20060711011740.0Z</li>
</ul>

@param dateText the date string.
@return the Date.
xmppserver/src/main/java/org/jivesoftware/openfire/ldap/LdapUserProvider.java