Converts the given numeric value to the output date format.
@param d The value to be converted
@param format The format to use for the value
@return The formatted value
333752
private String convertDecimal(double d, String format)
    {
        String ret = "";

        if(format.length() > 0)
        {
            DecimalFormat f = new DecimalFormat(format);
            ret = f.format(d);
        }
        else
        {
            ret = Double.toString(d);
        }

        return ret;
    }
155119
public static Date stringToDate(String dateString, String format) {

        return stringToDate(dateString, format, LENIENT_DATE);
    }
433561
public static String getShortDateString(long time, String format) {
        if (format == null || format.isEmpty()) {
            format = "yyyy-MM-dd";
        }

        SimpleDateFormat smpf = new SimpleDateFormat(format);
        return smpf.format(new Date(time));
    }
627029
public static String format(final long time, final String format) {
		return format(time, DateTimeFormat.forPattern(format));
	}
1206859
@NonNull
    public static String getNowDateTime(@NonNull String format) {
        SimpleDateFormat formatter = new SimpleDateFormat(format, Locale.ENGLISH);
        Date curDate = new Date(System.currentTimeMillis());
        return formatter.format(curDate);
    }
778944
static public String getFormattedTime(long dt, String format, boolean isTime)
    {
        String ret = "";
        SimpleDateFormat df = null;

        try
        {
            if(dt > 0)
            {
                df = formatPool.getFormat(format);
                if(isTime)
                    df.setTimeZone(DateUtilities.getCurrentTimeZone());
                else
                    df.setTimeZone(DateUtilities.defaultTZ);
                ret = df.format(new Date(dt));
            }
        }
        catch(Exception e)
        {
        }

        if(df != null)
            formatPool.release(df);

        return ret;
    }
123976
public Date asDate(String format) throws ParsableException {
        SimpleDateFormat dateformat = new SimpleDateFormat(format);
        return asDate(dateformat);
    }
606992
public LambdaDslJsonArray timestamp(final String format, final Date example) {
        pactArray.timestamp(format, example);
        return this;
    }
360791
public static String getFormatDate(String format, String zoneId) {
        return getFormatDate(format, new Date(), zoneId);
    }
326591
public static PactDslJsonRootValue timestamp(String format, Date example) {
    FastDateFormat instance = FastDateFormat.getInstance(format);
    PactDslJsonRootValue value = new PactDslJsonRootValue();
    value.setValue(instance.format(example));
    value.setMatcher(value.matchTimestamp(format));
    return value;
  }
1107337
public static String convertFormat(String format) {
		if (format == null)
			return null;
		else {
			// day of week
			format = format.replaceAll("EEE", "D");
			// year
			format = format.replaceAll("yy", "y");

			// month
			if (format.indexOf("MMM") != -1) {
				format = format.replaceAll("MMM", "M");
			} else {
				format = format.replaceAll("M", "m");
			}
			return format;
		}
	}
542988
public String date (String format, Object arg)
    {
        Date when = massageDate(arg);
        if (when == null) {
            return format;
        }
        SimpleDateFormat fmt = new SimpleDateFormat(format, getLocale());
        return fmt.format(when);
    }
1110153
public static String formatDate(java.util.Date pDate, String format) {

        if (pDate == null) {
            pDate = new java.util.Date();
        }
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(pDate);
    }
1229309
public String formatDate(String format, Locale loc) {
		MultivaluedMap<String, String> params = new MultivaluedHashMap<>();
		params.putSingle("format", format);
		params.putSingle("locale", loc == null ? null : loc.toString());
		return getEntity(invokeGet("utils/formatdate", params), String.class);
	}
130857
public static SimpleDateFormat newDateFormat(String format) {
		SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.ROOT);
		sdf.setLenient(false);
		return sdf;
	}
1141854
public static String dateToStr(Date date, String format) {
        return new SimpleDateFormat(format).format(date);
    }
1299179
public String format(String format)
  {
    CharBuffer cb = new CharBuffer();

    return format(cb, format).close();
  }