Here you can find the source of parseDate(DateFormat f, String date)
Parameter | Description |
---|---|
f | formatter |
date | String date value |
Parameter | Description |
---|---|
RuntimeException | if ParseException is thrown |
public static Date parseDate(DateFormat f, String date)
//package com.java2s; import java.text.DateFormat; import java.text.ParseException; import java.util.Date; public class Main { /**//from w ww . j a v a 2 s .c o m * Parse date with formatter. * * @param f formatter * @param date String date value * @return date * @throws RuntimeException if {@link ParseException} is thrown */ public static Date parseDate(DateFormat f, String date) { try { return f.parse(date); } catch (ParseException e) { throw new RuntimeException(e); } } }