Java Code Snippet for Parsing Strings into Date

SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd");
String input = "2007-05-04";
Date d;
try {
    d = formatter.parse(input);
}
catch (ParseException e) {
   e.printStackTrace();
}

Related posts:

  1. Java Code Snippet for Sending Email using Gmail SMTP Server
  2. Signing Java Applets Using RSA Certificate
  3. Installing TinyMCE Editor in Drupal
  4. Setting Up Log4j Quickstart Guide
  5. Generate Static Reports with AWStats
This entry was posted in Java and tagged . Bookmark the permalink.

Comments are closed.