How to format Joda-Time DateTime to only mm/dd/yyyy?

前端 未结 9 1250
挽巷
挽巷 2020-11-29 15:52

I have a string \"11/15/2013 08:00:00\", I want to format it to \"11/15/2013\", what is the correct DateTimeFormatter pattern?

9条回答
  •  孤独总比滥情好
    2020-11-29 16:16

    I have a very dumb but working option. if you have the String fullDate = "11/15/2013 08:00:00";

       String finalDate = fullDate.split(" ")[0];
    

    That should work easy and fast. :)

提交回复
热议问题