java - Joda-time from LocalDateTime string to LocalDate -


i'm using jodatime date , time of creation of account. format being

2017-04-05t12:38:35.585 

when store in database string i've looked around ways format string localdate haven't been succesful in i've found online. next step horrible solution in opinion loop through string until find t , remove after it. i'm left

2017-04-05.  

but ideally if possible have date

05/04/2017 

use isodatetimeformat localdatetime , localdate. careful use right locale

string input="2017-04-05t12:38:35.585";  localdatetime ldt = isodatetimeformat.localdateoptionaltimeparser()                     .withlocale(locale.english)                     .parselocaldatetime(input);  system.out.println(ldt.tolocaldate());//prints 2017-04-05 

Comments