Here you can find the source of convertDateFromString(String data)
Parameter | Description |
---|---|
data | a parameter |
Parameter | Description |
---|---|
ParseException | an exception |
public static Date convertDateFromString(String data) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**//from ww w . j ava2 s. c om * */ public static final String DD_MM_YYYY = "dd/mm/yyyy"; /** * @param data * @return * @throws ParseException */ public static Date convertDateFromString(String data) throws ParseException { SimpleDateFormat dateFormat = new SimpleDateFormat(DD_MM_YYYY); return dateFormat.parse(data); } }