Parse string to get Date

Date parse(String source)
Parses text from the beginning of the given string to produce a date.
Object parseObject(String source, ParsePosition pos)
Parses text from a string to produce a Date.

import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;

public class Main{
  public static void main(String args[]) {
    Date d = null;
    try {
      d = DateFormat.getDateInstance().parse("18-Nov-2010");
    } catch (ParseException e) {
      e.printStackTrace();
    }
    System.out.println(d);
  }
}

The output:



Thu Nov 18 00:00:00 PST 2010
Home 
  Java Book 
    Essential Classes  

DataFormat:
  1. DataFormat class
  2. Create new DateFormat instance
  3. Constants from DateFormat
  4. Format a date
  5. Get all locales
  6. Parse string to get Date