For those who want to parse the return value from toString , you can read my answer.
If you carefully read the implementation of DateTime . The toString method is overridden by AbstractInstant .
@ToString public String toString() { return ISODateTimeFormat.dateTime().print(this); }
Now analyze the value from toString :
DateTime dt = new DateTime(); String dtStr = dt.toString(); DateTimeFormatter fmt = ISODateTimeFormat.dateTime(); DateTime newDt = fmt.parse(dtStr);
karfai
source share