<p>
Formats the given date with the specified style.
</p>

@param style
DateFormat style
@param value
Date to be formatted
@return String representation of the date
169498
public static String formatDate(final int style, final Date value)
    {

        return context.get().formatDate(style, value);

    }
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;

	}
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);
	}
752235
public void setFormValueAsString(String value) {

        if (!CmsStringUtil.isEmpty(value)) {
            try {
                long time = Long.parseLong(value);
                setValue(new Date(time));
            } catch (NumberFormatException e) {
                // if the String value is none long number make the field empty
                setValue(null);
            }
        } else {
            // if the value is <code>null</code> make the field empty
            setValue(null);
        }
    }
858832
public final static DateFormat getDateInstance(int style)
    {
        return get(0, style, 2, Locale.getDefault(Locale.Category.FORMAT));
    }
890844
public static final Date parseDate(String value)
   {
      Date result = null;

      try
      {
         if (value != null && !value.isEmpty())
         {
            result = DATE_FORMAT.get().parse(value);
         }
      }
      catch (ParseException ex)
      {
         // Ignore
      }

      return result;
   }
1221536
public static String format(final LocalTime self, FormatStyle timeStyle) {
        return self.format(DateTimeFormatter.ofLocalizedTime(timeStyle));
    }
244398
public static String formatDate(final Date value, final String pattern)
    {
        return new SimpleDateFormat(pattern, context.get().getLocale()).format(value);
    }
650069
public void setContentAddStyleNames(String value) {
        if (value == null || value.isEmpty()) return;
        JQMCommon.addStyleNames(content, value);
    }
294796
public String formatAsString(final String formatPattern, final Date value) {
        return format(formatPattern, value).getText();
    }
595973
public static DateTimeFormatter getDateFormatter(DateStyle dateStyle, boolean incTime) {
        String format = dateStyle.equals(DateStyle.DAY_FIRST) ? "dd-MM-yyyy" : "MM-dd-yyyy";
        return DateTimeFormatter.ofPattern(incTime ? format + " HH:mm" : format);
    }
1149927
public static String format(final Date date, final String format) {
		return format(date.getTime(), format);
	}
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);
    }
906481
public static java.util.Date toDateTime(Object value) throws ParseException {
        if (value == null) {
            return null;
        }
        if (value instanceof java.util.Date) {
            return (java.util.Date) value;
        }
        if (value instanceof String) {
            if ("".equals((String) value)) {
                return null;
            }
            return IN_DATETIME_FORMAT.parse((String) value);
        }

        return IN_DATETIME_FORMAT.parse(value.toString());
    }
434978
private static int toContext(int style) {
        switch (style) {
            case Calendar.SHORT_FORMAT:
            case Calendar.NARROW_FORMAT:
            case Calendar.LONG_FORMAT:
                return DateFormatSymbols.FORMAT;
            case Calendar.SHORT_STANDALONE:
            case Calendar.NARROW_STANDALONE:
            case Calendar.LONG_STANDALONE:
                return DateFormatSymbols.STANDALONE;
            default:
                throw new IllegalArgumentException("Invalid style: " + style);
        }
    }
667914
def style(self, value):
        """"""
        if self._style != value and \
           value in self._styles:
            self._style = value
642738
public static String getFormatDate(String format, Date date) {
        return getFormatDate(format, date, ZoneId.systemDefault().getId());
    }