Here you can find the source of parseDate(String date)
Parses a date string to a Date instance using format "ddMMyyyy".
Parameter | Description |
---|---|
date | a date string in "ddMMyyyy" format |
Parameter | Description |
---|---|
Exception | to JUnit |
public static Date parseDate(String date) throws Exception
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**//ww w . j av a 2s. c o m * <p> * Parses a date string to a Date instance using format "ddMMyyyy". * </p> * * @param date a date string in "ddMMyyyy" format * * @return the corresponding Date instance. * * @throws Exception to JUnit */ public static Date parseDate(String date) throws Exception { SimpleDateFormat format = new SimpleDateFormat("ddMMyyyy"); return format.parse(date); } }