Java Year Parse parseDateSlashedMmDdYyyy(String dateStr)

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

Description

parse Date Slashed Mm Dd Yyyy

License

LGPL

Declaration

public static Date parseDateSlashedMmDdYyyy(String dateStr) 

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;

public class Main {
    public static Date parseDateSlashedMmDdYyyy(String dateStr) {
        return parseDate(formatSlashedMmDdYyyy(), dateStr);
    }/*from ww w . j a v a 2s  .  c om*/

    /**
     * Parse a String into a Date.
     * @param sdf - the DateFormat used for parsing, lenient.
     * @param dateStr - the input string.
     * @return - the date
     * @throws RuntimeException for parsing exceptions.
     */
    public static Date parseDate(DateFormat sdf, String dateStr) {
        try {
            return sdf.parse(dateStr);
        } catch (ParseException e) {
            throw new RuntimeException(e);
        }
    }

    /** DateFormat for "MM/dd/yyyy". */
    public static DateFormat formatSlashedMmDdYyyy() {
        return new SimpleDateFormat("MM/dd/yyyy");
    }
}

Related

  1. parse2yyyyMMddHHmmss(String date)
  2. parseDashedDateDDMMYYYY(String date)
  3. parseDateTime_mmddyyyy(String s)
  4. parseDateyyyy_MM_DD2(String ds)
  5. parseDateyyyyMMdd(String value)
  6. parseddMMyyyy(String dateStr)