Skip to content

Instantly share code, notes, and snippets.

@Eugeny
Created April 22, 2011 14:52
Show Gist options
  • Save Eugeny/936817 to your computer and use it in GitHub Desktop.
Save Eugeny/936817 to your computer and use it in GitHub Desktop.
import java.text.ParseException;
import java.text.SimpleDateFormat;
public final class test {
public static void main(String[] args) {
SimpleDateFormat sdf = new SimpleDateFormat("MMM dd HH:mm:ss yyyy");
try {
sdf.parse("Apr 21 09:37:04 2011");
} catch (ParseException e) {
e.printStackTrace();
}
}
}
--------------------------------
java.text.ParseException: Unparseable date: "Apr 21 09:37:04 2011"
at java.text.DateFormat.parse(DateFormat.java:337)
at test.main(test.java:12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment