get formated date String

@param time
@param format if is null or empty, will use "yyyy-MM-dd"
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));
    }
854630
public static String getDateFormat(final Date date, final String pattern) {

    SimpleDateFormat simpleDateFormat = buildDateFormat(pattern);
    return simpleDateFormat.format(date);
  }
352692
private String convertDateTime(long dt, String format)
    {
        if(format.length() == 0)
            format = Formats.DATETIME_FORMAT;
        return FormatUtilities.getFormattedDateTime(dt, format, false, 0L);
    }
343655
public static function format($time = null, $format = 'Y-m-d H:i:s') {
		if (!empty($time) && !is_numeric($time)) {
			$format = $time;
			$time = time();
		}
		if (is_null($time)) {
			$time = time();
		}
		return date($format, $time);
	}
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;
		}
	}
236677
public static String format(final Date date, String format) {

		if (date != null) {

			if (StringUtils.isBlank(format)) {

				format = DateProperty.getDefaultFormat();

			}

			return new SimpleDateFormat(format).format(date);
		}

		return null;

	}
3991
public static String formatTime (Date date)
    {
        return (date == null) ? "" : _tfmt.format(date).toLowerCase();
    }
1207162
public static String formatTime(Date date) {
		if (null == date) {
			return null;
		}
		return DatePattern.NORM_TIME_FORMAT.format(date);
	}
983636
public static String formatDateTime (Date date)
    {
        return (date == null) ? "" : _msgs.dateTime(formatDate(date), formatTime(date));
    }
928768
public static String format(Date date, DateFormat format) {
		if (null == format || null == date) {
			return null;
		}
		return format.format(date);
	}
1305087
public static Date stringToDate(String source, String format) throws ParseException {

        if (StringUtils.isEmpty(source))
            return null;

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
        return simpleDateFormat.parse(source);
    }
627029
public static String format(final long time, final String format) {
		return format(time, DateTimeFormat.forPattern(format));
	}
472989
public static String getTimestamp(Date time) {
        return getTimestampFormatter().format(time == null ? new Date() : time);
    }
437191
public function format($format = '%d/%m/%Y')
    {
        if ($this->time == null) {
            return false;
        }
        
        return strftime($format, $this->time);
    }
156032
static public String getFormattedDateTime(long dt, TimeZone tz, String format)
    {
        SimpleDateFormat df = new SimpleDateFormat(format);
        if(tz != null)
            df.setTimeZone(tz);
        return df.format(new Date(dt));
    }
486059
public static String format( DateTimeFormat format, TimeZone timeZone, Date date ) {
        return format.format( date, timeZone );
    }
1009533
public static String format(Date date, String format) {
		if (null == date || StrUtil.isBlank(format)) {
			return null;
		}
		return format(date, FastDateFormat.getInstance(format));
	}