Here you can find the source of parseDate(final String date, final String format)
Parameter | Description |
---|---|
date | a parameter |
format | a parameter |
Parameter | Description |
---|---|
ParseException | an exception |
public static Date parseDate(final String date, final String format) throws ParseException
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**//ww w .j av a 2 s . c o m * Parse string to date using given format. * * @param date * @param format * @return Date * @throws ParseException */ public static Date parseDate(final String date, final String format) throws ParseException { final SimpleDateFormat dfmt = new SimpleDateFormat(format); return dfmt.parse(date); } }