Here you can find the source of getDay(String string)
public static Date getDay(String string)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /** Returns the day given a string in format dd-MMM-yyyy. *///w w w. j a v a 2 s. c o m public static Date getDay(String string) { if (string == null) { return null; } Date date = null; try { date = (new SimpleDateFormat("dd-MMM-yyyy").parse(string)); } catch (ParseException ex) { return null; } return date; } }