String getUtcDate(Date date) {
        // package-private for test.
        Calendar calendar = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
        calendar.setTime(date);
        // This makes sure the date is formatted as the xs:dateTime type.
        return DatatypeConverter.printDateTime(calendar);
    }
Gets the ISO 8601 formatted date (UTC) as specified in XEP-0082: XMPP Date and Time Profiles.

@param date The date.
@return The UTC formatted date.
xmppserver/src/main/java/org/jivesoftware/openfire/handler/IQEntityTimeHandler.java