common/src/main/java/org/jboss/pnc/common/util/TimeUtils.java
public static String generateTimestamp(boolean generationEnabled, Date dateInstant) {
        if(!generationEnabled)
            return null;

        Calendar instant = new Calendar.Builder().
                setInstant(dateInstant)
                .setTimeZone(TimeZone.getTimeZone("UTC"))
                .build();


        return String.format("t%d%02d%02d-%02d%02d%02d-%03d", instant.get(Calendar.YEAR), instant.get(Calendar.MONTH) + 1,
                instant.get(Calendar.DAY_OF_MONTH), instant.get(Calendar.HOUR_OF_DAY), instant.get(Calendar.MINUTE),
                instant.get(Calendar.SECOND), instant.get(Calendar.MILLISECOND));
    }
public static String generateTimestamp(boolean generationEnabled, Date dateInstant) {
        if(!generationEnabled)
            return null;

        Calendar instant = new Calendar.Builder().
                setInstant(dateInstant)
                .setTimeZone(TimeZone.getTimeZone("UTC"))
                .build();


        return String.format("t%d%02d%02d-%02d%02d%02d-%03d", instant.get(Calendar.YEAR), instant.get(Calendar.MONTH) + 1,
                instant.get(Calendar.DAY_OF_MONTH), instant.get(Calendar.HOUR_OF_DAY), instant.get(Calendar.MINUTE),
                instant.get(Calendar.SECOND), instant.get(Calendar.MILLISECOND));
    }
Generate timestamp in the format tYYYYMMDD-HHMMSS-XXX  (XXX = miliseconds)

@param generationEnabled Flag indicating, if the generation of timestamp is enabled
@param dateInstant Time instant for which the timestamp will be generated
@return Timestamp string or null, if generation is disabled