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);
Изходът е
2012-01-02T00:00:00.000+02:00
Mon Jan 02 00:00:00 EET 2012
Следва за:
final String dateString = "Jan 1, 2012";
изходът е:
2012-01-01T00:00:00.000+02:00
Sun Jan 01 00:00:00 EET 2012