Java Parse Date Pattern YYYY parseDT(String fmt, String timeline)

Here you can find the source of parseDT(String fmt, String timeline)

Description

parse DT

License

LGPL

Declaration

public static Date parseDT(String fmt, String timeline) throws ParseException 

Method Source Code


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

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class Main {
    public static final String FMT_DEFAULT = "yyyy-MM-dd HH:mm:ss";
    private static final Map<String, SimpleDateFormat> MAP = new HashMap<String, SimpleDateFormat>(6);

    public static Date parseDT(String timeline) throws ParseException {
        return getFmt(FMT_DEFAULT).parse(timeline);
    }/*  ww w.j a va  2 s .c om*/

    public static Date parseDT(String fmt, String timeline) throws ParseException {
        return getFmt(fmt).parse(timeline);
    }

    public static DateFormat getFmt(String fmt) {
        return MAP.get(fmt);
    }
}

Related

  1. parseDatabaseDate(String dateString)
  2. parseDD(String dateStr)
  3. parseDelayTime(String time)
  4. parseDIGTime(String timestr)
  5. parseDisplay4Key(Object date)
  6. parseDueDate(String date)
  7. parseEapoDate(String date)
  8. parseEuropeanDateAnd12HrsTimeString(String aDateString, String aTimeString)
  9. parseEXIFFormat(String dateString)