Format a date using the {@link DateTimeFormat} and {@link TimeZone} given in
parameters

@param format format to use
@param timeZone timezone to use
@param date date to format
@return the formatted date
486059
public static String format( DateTimeFormat format, TimeZone timeZone, Date date ) {
        return format.format( date, timeZone );
    }
157893
public static Date parseAWSDate(String date) {
		if (date == null) {
			return null;
		}
		return TIME_FORMATTER.parseDateTime(date).toDate();
	}
1225262
static public long getDateTime(String s, String format, TimeZone tz)
    {
        long ret = 0L;
        SimpleDateFormat df = null;

        try
        {
            if(s != null && s.length() > 0)
            {
                df = formatPool.getFormat(format);
                df.setTimeZone(tz);
                Date dt = df.parse(s);
                ret = dt.getTime();
            }
        }
        catch(Exception e)
        {
        }

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

        return ret;
    }
403998
public static String getFormatDate(String format, Date date, String zoneId) {
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(format);
        return dateTimeFormatter
            .format(date.toInstant().atZone(ZoneId.of(zoneId)).toLocalDateTime());
    }
3991
public static String formatTime (Date date)
    {
        return (date == null) ? "" : _tfmt.format(date).toLowerCase();
    }
627029
public static String format(final long time, final String format) {
		return format(time, DateTimeFormat.forPattern(format));
	}
578047
public synchronized static String formatDate(final java.util.Date object, String pattern) {
		if (pattern == null || pattern.equals("")) {
			pattern = JKFormatUtil.DEFAULT_DATE_PATTERN;
		}
		return JKFormatUtil.getDateFormatter(pattern).format(object);
	}
1345255
private String format(final Date date) {
		synchronized (formatter) {
			if (lastDate == null || date.getTime() / divisor != lastDate.getTime() / divisor) {
				lastDate = date;
				lastFormat = formatter.format(date);
			}
			return lastFormat;
		}
	}
690945
public static String format(Date date) {
        String format = LOCAL_DATE_FORMAT.format(date);
        // Java 6 does not have a convenient way of having the colon in the timezone offset
        return format.substring(0,22) + ":" + format.substring(22);
    }
807450
private String formatTime(Date value)
   {
      return (value == null ? null : m_formats.getTimeFormat().format(value));
   }
177062
@Override
    public String format(Date date, String mask) {
	return format(date, mask, null);
    }
18859
private static Date toDateWithFormatString(String date, String format) {
    if (date == null) {
      return null;
    }

    try {
      return strategy.formatFor(format).parse(date);
    } catch (ParseException e) {
      UTILS_LOGGER.trace("Unable to parse date '{}' using format string '{}': {}", date, format, e);

      return null;
    }
  }
1324545
public static String formatDate(@NotNull String pattern, @NotNull Date date) {
		return FastDateFormat.getInstance(pattern).format(date);
	}
840163
public static String formatDate(String format, Locale loc) {
		return formatDate(timestamp(), format, loc);
	}
785079
public function datetime($datetime, $timezone = null, $format = 'M/d/Y - h:i:s A')
    {
        $datetime = new \DateTime($datetime);

        if($timezone) {

            $datetime->setTimezone(new \DateTimeZone($timezone));
        }

        return $datetime->format($format); 
    }
889734
@Nonnull
    @SuppressFBWarnings("RV_RETURN_VALUE_IGNORED_BAD_PRACTICE")
    public String format(@Nonnull Date date) {
        SimpleDateFormat dateFormat = dateFormats.poll();
        if (dateFormat == null) {
            dateFormat = new SimpleDateFormat(pattern, locale);
            dateFormat.setTimeZone(timeZone);
        }
        try {
            return dateFormat.format(date);
        } finally {
            dateFormats.offer(dateFormat);
        }
    }
995956
public static String dateToString(Date date) {
        final TimeZone utc = TimeZone.getTimeZone("UTC");

        SimpleDateFormat tformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
        tformat.setTimeZone(utc);
        return tformat.format(date);
    }