Java Date Format Pattern getFormat(String pattern)

Here you can find the source of getFormat(String pattern)

Description

get Format

License

Apache License

Declaration

public static DateFormat getFormat(String pattern) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.util.HashMap;

import java.util.Map;

public class Main {
    private static final Map<String, DateFormat> DFS = new HashMap<String, DateFormat>();

    public static DateFormat getFormat(String pattern) {
        DateFormat format = DFS.get(pattern);
        if (format == null) {
            format = new SimpleDateFormat(pattern);
            DFS.put(pattern, format);/*  www .  ja v  a2s.c  o  m*/
        }
        return format;
    }
}

Related

  1. getFormat(long stamp)
  2. getFormat(long stamp, String pattern)
  3. getFormat(String format)
  4. getFormat(String formatPattern)
  5. getFormat(String formatString)
  6. getFormatCurrentAdd(int amount, String format)
  7. getFormattedValue(Object customFieldValue)
  8. getFormatter()
  9. getFormatter()