Here you can find the source of stringToDate(String date)
Parameter | Description |
---|---|
date | the date |
public static Date stringToDate(String date)
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/*w ww . j a v a2 s . com*/ * String to date. * * @param date * the date * @return the date */ public static Date stringToDate(String date) { Date formattedDate = null; try { SimpleDateFormat sd = new SimpleDateFormat("dd/MM/yyyy"); formattedDate = sd.parse(date); } catch (ParseException e) { System.out.println("<<<<error >>>>" + e.getMessage()); e.printStackTrace(); } return formattedDate; } }