Here you can find the source of parseDateyyyyMMdd(String value)
Parameter | Description |
---|---|
value | <br> <div class="de"> value</div> <div class="fr"> value</div> <div class="it"> value</div> |
public static Date parseDateyyyyMMdd(String value)
//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); } } }