Java Parse Date Pattern YYYY parseDD(String dateStr)

Here you can find the source of parseDD(String dateStr)

Description

yyyy-MM-dd

License

Apache License

Parameter

Parameter Description
dateStr a parameter

Exception

Parameter Description
ParseException an exception

Declaration

public static Date parseDD(String dateStr) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    private final static ThreadLocal<SimpleDateFormat> YYYY_MM_DD_FORMAT = new ThreadLocal<SimpleDateFormat>() {
        @Override/*from  w  w  w  .  ja v a  2  s  .  c om*/
        protected SimpleDateFormat initialValue() {
            return new SimpleDateFormat("yyyy-MM-dd");
        }

        ;

    };

    /**
     * yyyy-MM-dd
     *
     * @param dateStr
     * @return
     * @throws ParseException
     */
    public static Date parseDD(String dateStr) {
        try {
            return YYYY_MM_DD_FORMAT.get().parse(dateStr);
        } catch (Exception e) {
        }
        return null;
    }
}

Related

  1. parseCalendarString(String dateTimeString)
  2. parseCDADateFormat(String xsdDate)
  3. parseCompactDate(String exp)
  4. parseCoTDate(String dateString)
  5. parseDatabaseDate(String dateString)
  6. parseDelayTime(String time)
  7. parseDIGTime(String timestr)
  8. parseDisplay4Key(Object date)
  9. parseDT(String fmt, String timeline)