class CommonUtils {

    public static String getCurrentDateStringWithFormat(String timeZone, String format) {

        SimpleDateFormat dateFormatter = new SimpleDateFormat(format);
        if (!Strings.isNullOrEmpty(timeZone))
            dateFormatter.setTimeZone(TimeZone.getTimeZone(timeZone));
        else
            dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));

        return dateFormatter.format(new Date());
    }

}