final String dateString = "Jan 2, 2012";
final DateTimeFormatter dtf = new DateTimeFormatterBuilder().appendMonthOfYearShortText().appendLiteral(" ").appendDayOfMonth(1).appendLiteral(", ").appendYear(4, 4).toFormatter();
final DateTime jodaDate = dtf.parseDateTime(dateString);
System.out.println(jodaDate);
final Date javaDate = new Date(jodaDate.getMillis());
System.out.println(javaDate);
La sortie est
2012-01-02T00:00:00.000+02:00
Mon Jan 02 00:00:00 EET 2012
Suivant pour :
final String dateString = "Jan 1, 2012";
la sortie est :
2012-01-01T00:00:00.000+02:00
Sun Jan 01 00:00:00 EET 2012