Gives the W3C format of the PdfDate.
@param d the date in the format D:YYYYMMDDHHmmSSOHH'mm'
@return a formatted date
552751
public static String getW3CDate(String d) {
        if (d.startsWith("D:"))
            d = d.substring(2);
        StringBuffer sb = new StringBuffer();
        if (d.length() < 4)
            return "0000";
        sb.append(d.substring(0, 4)); //year
        d = d.substring(4);
        if (d.length() < 2)
            return sb.toString();
        sb.append('-').append(d.substring(0, 2)); //month
        d = d.substring(2);
        if (d.length() < 2)
            return sb.toString();
        sb.append('-').append(d.substring(0, 2)); //day
        d = d.substring(2);
        if (d.length() < 2)
            return sb.toString();
        sb.append('T').append(d.substring(0, 2)); //hour
        d = d.substring(2);
        if (d.length() < 2) {
            sb.append(":00Z");
            return sb.toString();
        }
        sb.append(':').append(d.substring(0, 2)); //minute
        d = d.substring(2);
        if (d.length() < 2) {
            sb.append('Z');
            return sb.toString();
        }
        sb.append(':').append(d.substring(0, 2)); //second
        d = d.substring(2);
        if (d.startsWith("-") || d.startsWith("+")) {
            String sign = d.substring(0, 1);
            d = d.substring(1);
            String h = "00";
            String m = "00";
            if (d.length() >= 2) {
                h = d.substring(0, 2);
                if (d.length() > 2) {
                    d = d.substring(3);
                    if (d.length() >= 2)
                        m = d.substring(0, 2);
                }
                sb.append(sign).append(h).append(':').append(m);
                return sb.toString();
            }
        }
        sb.append('Z');
        return sb.toString();
    }
284686
public static String getDateString(String format, Date date) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(date);
    }
64994
@Nullable
  public static String getAsStringW3C (@Nullable final ZonedDateTime aDateTime)
  {
    if (aDateTime == null)
      return null;
    final DateTimeFormatter aFormatter = PDTFormatter.getForPattern (FORMAT_W3C, LOCALE_TO_USE);
    return aFormatter.format (aDateTime);
  }
922355
public static DateFormat getAlignedFormat() {
		if (DATE_FORMAT instanceof SimpleDateFormat) {
			SimpleDateFormat sdf = (SimpleDateFormat) DATE_FORMAT;
			String pattern = sdf.toPattern()
					.replaceAll("M+", "MM")
					.replaceAll("d+", "dd")
					.replaceAll("h+", "hh")
					.replaceAll("H+", "HH");
			sdf.applyPattern(pattern);
			return sdf;
		} else {
			return DATE_FORMAT;
		}
	}
638206
public String format(Date date) {
		Calendar cal = new GregorianCalendar();
		cal.setTime(date);
		return DatatypeConverter.printDateTime(cal);
	}
1053935
@Nullable
  public static String getAsStringW3C (@Nullable final LocalDateTime aDateTime)
  {
    if (aDateTime == null)
      return null;
    return getAsStringW3C (aDateTime.atOffset (ZoneOffset.UTC));
  }
1357466
public String getAsText() {
        LocalDate value = (LocalDate) getValue();
        return (value != null ? value.toString(this.formatter) : "");
    }
682102
public static String getHourStr() {
        java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyyMMddHH");
        return sdf.format(new Date());
    }
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);
    }
7641
public static String generateDomainDate(final Date domainDate) {
        if (domainDate == null) {
            throw new SwidException("domainDate isn't defined");
        }

        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
        return dateFormat.format(domainDate);
    }
983236
private String getFormattedDate(int dateTimeFormat) {

        DateFormat df;
        String result;
        if (isWholeDay()) {
            df = DateFormat.getDateInstance(dateTimeFormat, m_series.getLocale());
            result = df.format(getStart());
            if (getLastDay().after(getStart())) {
                result += DATE_SEPARATOR + df.format(getLastDay());
            }
        } else {
            df = DateFormat.getDateTimeInstance(dateTimeFormat, DateFormat.SHORT, m_series.getLocale());
            result = df.format(getStart());
            if (getEnd().after(getStart())) {
                if (isMultiDay()) {
                    result += DATE_SEPARATOR + df.format(getEnd());
                } else {
                    df = DateFormat.getTimeInstance(DateFormat.SHORT, m_series.getLocale());
                    result += DATE_SEPARATOR + df.format(getEnd());
                }
            }
        }

        return result;
    }
1177143
@MapMethod
    public Date parseDate(String d, String format){
        return Objects.parseDate(d,format);
    }
264730
public String dateToMWTimeStamp(Date date) {
    SimpleDateFormat mwTimeStampFormat = new SimpleDateFormat("yyyyMMddHHmmss");
    String result = mwTimeStampFormat.format(date);
    return result;
  }
322619
@Override
    public String getAsText() {
        Date value = (Date) getValue();
        DateFormat dateFormat = this.dateFormat;
        if (dateFormat == null)
            dateFormat = TIME_FORMAT;
        return (value != null ? dateFormat.format(value) : "");
    }
448903
public String dateToStringDateFormat(Date date)
   {
       if (date == null)
           return null;
       return gDateFormat.format(date);
   }
102185
public static String format(Date date) {
    Calendar calendar = new GregorianCalendar(TIMEZONE_Z, Locale.US);
    calendar.setTime(date);

    // estimate capacity of buffer as close as we can (yeah, that's pedantic ;)
    int capacity = "yyyy-MM-ddThh:mm:ss.sssZ".length();
    StringBuilder formatted = new StringBuilder(capacity);
    padInt(formatted, calendar.get(Calendar.YEAR), "yyyy".length());
    formatted.append('-');
    padInt(formatted, calendar.get(Calendar.MONTH) + 1, "MM".length());
    formatted.append('-');
    padInt(formatted, calendar.get(Calendar.DAY_OF_MONTH), "dd".length());
    formatted.append('T');
    padInt(formatted, calendar.get(Calendar.HOUR_OF_DAY), "hh".length());
    formatted.append(':');
    padInt(formatted, calendar.get(Calendar.MINUTE), "mm".length());
    formatted.append(':');
    padInt(formatted, calendar.get(Calendar.SECOND), "ss".length());
    formatted.append('.');
    padInt(formatted, calendar.get(Calendar.MILLISECOND), "sss".length());
    formatted.append('Z');
    return formatted.toString();
  }
846253
@MapMethod
    public String formatDate(Date d, String format){
        return Objects.formatDate(d, format);
    }