Java Year Parse parseDateyyyyMMdd(String value)

Here you can find the source of parseDateyyyyMMdd(String value)

Description

Parse date in format yyyyMMdd.

License

Open Source License

Parameter

Parameter Description
value <br> <div class="de"> value</div> <div class="fr"> value</div> <div class="it"> value</div>

Return

java.util.Date

Declaration

public static Date parseDateyyyyMMdd(String value) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 *
 * The authorship of this code and the accompanying materials is held by medshare GmbH, Switzerland.
 * All rights reserved. http://medshare.net
 *
 * Project Team: https://sourceforge.net/p/ehealthconnector/wiki/Team/
 *
 * This code is are made available under the terms of the Eclipse Public License v1.0.
 *
 * Accompanying materials are made available under the terms of the Creative Commons
 * Attribution-ShareAlike 4.0 License.//from   ww w . j a  v  a 2 s  . co  m
 *
 * Year of publication: 2015
 *
 *******************************************************************************/

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    /**
     * Parse date in format yyyyMMdd.
     * 
     * @param value
     * <br>
     *          <div class="de"> value</div> <div class="fr"> value</div> <div
     *          class="it"> value</div>
     * @return java.util.Date
     */
    public static Date parseDateyyyyMMdd(String value) {
        try {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
            return sdf.parse(value);
        } catch (ParseException e) {
            throw new IllegalArgumentException(
                    "Cannot parse date, value=[" + value + "]. Expected format is yyyyMMdd.", e);
        }
    }
}

Related

  1. parse2yyyyMMddHHmmss(String date)
  2. parseDashedDateDDMMYYYY(String date)
  3. parseDateSlashedMmDdYyyy(String dateStr)
  4. parseDateTime_mmddyyyy(String s)
  5. parseDateyyyy_MM_DD2(String ds)
  6. parseddMMyyyy(String dateStr)
  7. parseDdMmYyyyDate(String date)
  8. parseTimeByYYYYMMDDHHMMSS(String str)
  9. parseYYYYMMDD(String s)