Java Year Format getFormatToDateSimple(String yyyyMMdd)

Here you can find the source of getFormatToDateSimple(String yyyyMMdd)

Description

get Format To Date Simple

License

Open Source License

Declaration

public static Date getFormatToDateSimple(String yyyyMMdd) 

Method Source Code

//package com.java2s;

import java.util.Date;

public class Main {

    public static Date getFormatToDateSimple(String yyyyMMdd) {
        java.util.Date date = new java.util.Date();
        try {/*from www.  j  a  v  a 2s  . c o m*/
            yyyyMMdd = yyyyMMdd.replaceAll("/", "").replaceAll(":", "");
            java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyyMMdd");
            date = formatter.parse(yyyyMMdd);
        } catch (Exception e) {
            return null;
        }
        return date;
    }
}

Related

  1. formatyyyyMMddHHmmss(long time)
  2. get_Oracle_DateString_YYYYMMdd_HHmmss(java.util.Date date)
  3. getDDMMYYY_HHMM()
  4. getDDMMYYYYDate(Date date)
  5. getFirstDate(String yearMonthStr, String yearMonthFormat, String dateFormat)
  6. getStartAndEndWeekOfMonth(int year, int month, int week, String format)
  7. getStringFormatMMYYWithoutHyphens(Date aDate)
  8. getStringFormatYYYYMMddWithHyphens(Date aDate)
  9. getTimeByYMD()