Here you can find the source of stringToDate(String dateString)
Parameter | Description |
---|---|
dateString | the date string |
public static Date stringToDate(String dateString)
//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 www .j a va 2s . c om*/ * String to date. * * @param dateString * the date string * @return the date */ public static Date stringToDate(String dateString) { Date date; if (!dateString.equalsIgnoreCase("")) { try { date = new SimpleDateFormat("dd MMM yyyy").parse(dateString); return date; } catch (ParseException e) { } } return null; } }