I am using Joda API to format current time (the result must be a string formatted as "yyyy-MM-dd HH:mm:ss"). Below I provide my code and the error message:
DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
DateTime dt = new DateTime();
String datetime = dtf.parseDateTime(dt.toString()).toString();
Error message:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Invalid format: "2014-11-17T11:47:29.229+01:00" is malformed at "T11:47:29.229+01:00" at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:899)