Java Date Format Pattern getSdf(String formatPattern)

Here you can find the source of getSdf(String formatPattern)

Description

get Sdf

License

Open Source License

Declaration

public static SimpleDateFormat getSdf(String formatPattern) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

public class Main {
    private static ThreadLocal<SimpleDateFormat> sdfLocal = new ThreadLocal<SimpleDateFormat>();

    public static SimpleDateFormat getSdf(String formatPattern) {
        SimpleDateFormat sdf = sdfLocal.get();
        if (sdf == null) {
            sdf = new SimpleDateFormat(formatPattern);
            sdfLocal.set(sdf);//from w ww.j a v a 2  s. c o  m
        }
        return sdf;
    }
}

Related

  1. getMMdd()
  2. getMMDDYYHHMM()
  3. getMMDDYYYY(final Date date, final String separator)
  4. getMomentFormatter()
  5. getPooledSDF(String format)
  6. getSimpleDataFormattedFile(File file)
  7. getSortedTimetampFormat()
  8. getStringAcordFormat()
  9. getSupportedFormats()