The alternate ISO format, Pyyyy-Www-ddThh:mm:ss, which excludes months.
<p>
Even if months are present in the period, they are not output.
Fractional seconds (milliseconds) will appear if required.

@return the formatter
5179
public static PeriodFormatter alternateExtendedWithWeeks() {
        if (cAlternateExtendedWihWeeks == null) {
            cAlternateExtendedWihWeeks = new PeriodFormatterBuilder()
                .appendLiteral("P")
                .printZeroAlways()
                .minimumPrintedDigits(4)
                .appendYears()
                .appendSeparator("-")
                .minimumPrintedDigits(2)
                .appendPrefix("W")
                .appendWeeks()
                .appendSeparator("-")
                .appendDays()
                .appendSeparatorIfFieldsAfter("T")
                .appendHours()
                .appendSeparator(":")
                .appendMinutes()
                .appendSeparator(":")
                .appendSecondsWithOptionalMillis()
                .toFormatter();
        }
        return cAlternateExtendedWihWeeks;
    }
1206132
public String format(long timestamp) {

        // If the format is unknown, use the default formatter.
        if (invalidFormat) {
            return formatter.format(timestamp);
        }

        try {
            long delta = timestamp - refTimestamp;

            // If we need to reformat
            if (delta >= pdiff || delta < ndiff) {
                StringBuffer refTime = new StringBuffer();
                refTimestamp = timestamp;
                formatter.format(timestamp, refTime, position);

                refMilli = Long.parseLong(refTime.substring(position.getBeginIndex(), position.getEndIndex()));

                refBeginning = refTime.substring(0, position.getBeginIndex());
                refEnding = refTime.substring(position.getEndIndex());

                pdiff = 1000 - refMilli;
                ndiff = -refMilli;
                return refTime.toString();
            } else {
                StringBuffer sb = new StringBuffer();
                long newMilli = delta + refMilli;
                if (newMilli >= 100)
                    sb.append(refBeginning).append(newMilli).append(refEnding);
                else if (newMilli >= 10)
                    sb.append(refBeginning).append('0').append(newMilli).append(refEnding);
                else
                    sb.append(refBeginning).append("00").append(newMilli).append(refEnding);
                return sb.toString();

            }
        } catch (Exception e) {
            // Throw FFDC in case anything goes wrong
            // Still generate the date via the SimpleDateFormat
            invalidFormat = true;
            return formatter.format(timestamp);
        }
    }
380621
public String getFormatedTimestamp()
    {
        if(date == null){return "";}
        
        StringBuilder sb = new StringBuilder();
        GregorianCalendar g = new GregorianCalendar();
        g.setTime(date);
        sb.append(String.valueOf(g.get(GregorianCalendar.YEAR))).append("-");
        sb.append(twoDigitFormat(g.get(GregorianCalendar.MONTH) + 1)).append("-");
        sb.append(twoDigitFormat(g.get(GregorianCalendar.DAY_OF_MONTH))).append(" ");
        sb.append(twoDigitFormat(g.get(GregorianCalendar.HOUR))).append(":");
        sb.append(twoDigitFormat(g.get(GregorianCalendar.MINUTE))).append(":");
        sb.append(twoDigitFormat(g.get(GregorianCalendar.SECOND)));
        
        return sb.toString();
    }
1288542
public String getDate() {
        SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
        String date = formatter.format(calendar.getTime());

        return date;
    }
997702
private static DateFormat getDateFormat() {
        String pattern;
        int patternLength;
        int endOfSecsIndex;
        // Retrieve a standard Java DateFormat object with desired format.
        DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
        if (formatter instanceof SimpleDateFormat) {
            // Retrieve the pattern from the formatter, since we will need to
            // modify it.
            SimpleDateFormat sdFormatter = (SimpleDateFormat) formatter;
            pattern = sdFormatter.toPattern();
            // Append milliseconds and timezone after seconds
            patternLength = pattern.length();
            endOfSecsIndex = pattern.lastIndexOf('s') + 1;
            String newPattern = pattern.substring(0, endOfSecsIndex) + ":SSS z";
            if (endOfSecsIndex < patternLength)
                newPattern += pattern.substring(endOfSecsIndex, patternLength);
            // 0-23 hour clock (get rid of any other clock formats and am/pm)
            newPattern = newPattern.replace('h', 'H');
            newPattern = newPattern.replace('K', 'H');
            newPattern = newPattern.replace('k', 'H');
            newPattern = newPattern.replace('a', ' ');
            newPattern = newPattern.trim();
            sdFormatter.applyPattern(newPattern);
            formatter = sdFormatter;
        } else {
            formatter = new SimpleDateFormat("dd/MMM/yyyy HH:mm:ss:SSS z");
        }
        return formatter;
    }
96398
public Integer getMonth() {
		String dateValue = getValue();

		if (dateValue != null && dateValue.length() >= MONTH_END) {
			return parseDateComponent(dateValue.substring(MONTH_START, MONTH_END), getPaddingChar());
		} else {
			return null;
		}
	}
649649
public String createTimestamp() {
	Date date = new Date();
	//SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd H:mm:ss");
	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
	String formattedDate = sdf.format(date);
	return formattedDate;
    }
199606
public String getFormattedDate(String format) {
        SimpleDateFormat dateFormat = new SimpleDateFormat(format);
        return dateFormat.format(date);
    }
638056
@Override
  public DurationFormatter getFormatter() {
    if (f == null) {
      if (fallback != null) {
        fallback = fallback.withLocale(localeName).withTimeZone(timeZone);
      }
      formatter = getPeriodFormatter();
      builder = getPeriodBuilder();

      f = createFormatter();
    }
    return f;
  }
863819
public String getFormattedStatus() {
        final StringBuilder sb = new StringBuilder();
        final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS");
        sb.append(format.format(new Date(timestamp)));
        sb.append(SPACE);
        sb.append(getThreadName());
        sb.append(SPACE);
        sb.append(level.toString());
        sb.append(SPACE);
        sb.append(msg.getFormattedMessage());
        final Object[] params = msg.getParameters();
        Throwable t;
        if (throwable == null && params != null && params[params.length - 1] instanceof Throwable) {
            t = (Throwable) params[params.length - 1];
        } else {
            t = throwable;
        }
        if (t != null) {
            sb.append(SPACE);
            final ByteArrayOutputStream baos = new ByteArrayOutputStream();
            t.printStackTrace(new PrintStream(baos));
            sb.append(baos.toString());
        }
        return sb.toString();
    }
246765
public String format(Calendar calendar) {
    // As the relative period is calculated on epoch (timeInMillis), no TimeZone information is needed
    Calendar smscCalendar = Calendar.getInstance();
    return format(calendar, smscCalendar);
  }
268640
public static String timeFormat(final long milliseconds) {
        double seconds = milliseconds / 1000.0d;
        final NumberFormat fmt = new DecimalFormat("#0.000");
        return fmt.format(seconds);
    }
1369444
public static String datetime(long millis) {
		if (sFormat == null) {
			sFormat = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("UTC"),
					US);
		}
		return sFormat.format(millis);
	}
1166256
public static DateFormat getDateFormat() {
        if (DATE_FORMATS.get() == null) {
            DATE_FORMATS.set((DateFormat) BASE_DATE_FORMAT.clone());
        }
        return DATE_FORMATS.get();
    }
1032851
public StringFormatter getFormatter() {
		if (formatter == null) {
                    ResourceBundle b = ResourceBundle.getBundle(UI_RESOURCE_BUNDLE_NAME, new UTF8Control());
			formatter = new StringFormatter(b, getLocale());
		}
		return formatter;
	}
808814
public final static DateFormat getDateTimeInstance()
    {
        return get(DEFAULT, DEFAULT, 3, Locale.getDefault(Locale.Category.FORMAT));
    }
1040503
public static String dateToIsoString(Date inputDate) {
		DateFormat dateStringFormat = new SimpleDateFormat("yyyy-MM-dd");
		return dateStringFormat.format(inputDate);
	}