Java Utililty Methods Date Format Pattern

List of utility methods to do Date Format Pattern

Description

The list of methods to do Date Format Pattern are organized into topic(s).

Method

SimpleDateFormatgetFolderFormat()
get Folder Format
return new SimpleDateFormat("yyyy_MM_dd");
DateFormatgetFormat()
get Format
final SimpleDateFormat fmt = new SimpleDateFormat(SNAPSHOT_TSTAMP_FORMAT);
return fmt;
SimpleDateFormatgetFormat()
get Format
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
StringgetFormat(long stamp)
get Format
return getFormat(stamp, "dd.MM.yyyy HH:mm:ss.SSS");
StringgetFormat(long stamp, String pattern)
Get the dateFormat from given timestamp in milliseconds and the pattern
return new SimpleDateFormat(pattern).format(new Date(stamp));
SimpleDateFormatgetFormat(String format)
get Format
if (format == null || "".equals(format)) {
    format = DATE_FORMAT2;
return new SimpleDateFormat(format);
SimpleDateFormatgetFormat(String formatPattern)
get Format
Map<String, SimpleDateFormat> threadMap = FORMATS.get();
if (threadMap == null) {
    threadMap = new HashMap<String, SimpleDateFormat>();
    FORMATS.set(threadMap);
SimpleDateFormat format = threadMap.get(formatPattern);
if (format == null) {
    format = new SimpleDateFormat(formatPattern);
...
DateFormatgetFormat(String formatString)
get Format
if (formatCache.get() == null) {
    formatCache.set(new WeakHashMap<String, DateFormat>());
DateFormat format = formatCache.get().get(formatString);
if (format == null) {
    format = new SimpleDateFormat(formatString);
    format.setTimeZone(TimeZone.getTimeZone("UTC"));
    formatCache.get().put(formatString, format);
...
DateFormatgetFormat(String pattern)
get Format
DateFormat format = DFS.get(pattern);
if (format == null) {
    format = new SimpleDateFormat(pattern);
    DFS.put(pattern, format);
return format;
StringgetFormatCurrentAdd(int amount, String format)
get Format Current Add
Date d = getDateAdd(new Date(), amount);
return getFormatDateTime(d, format);