Android Date Format String Create getFormat(String pattern)

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

Description

get Format

License

Open Source License

Declaration

public static DateFormat getFormat(String pattern) 

Method Source Code

//package com.java2s;
//License from project: Open Source 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);/* ww w.  j a  v a  2  s. c  o  m*/
        }
        return format;
    }
}

Related

  1. getDateFormatSymbols(Locale locale)
  2. changeFormat(String gmtString, String orgFormat, String format)
  3. convertFormat(String src, String f1, String f2)
  4. dateFormatToString(int date, Context context)