Converting date-string to a different format

后端 未结 5 1174
再見小時候
再見小時候 2020-11-28 11:29

I have a string containing a date in the format YYYY-MM-DD.

How would you suggest I go about converting it to the format DD-MM-YYYY in the

5条回答
  •  被撕碎了的回忆
    2020-11-28 11:46

    Best to use a SimpleDateFormat (API) object to convert the String to a Date object. You can then convert via another SimpleDateFormat object to whatever String representation you wish giving you tremendous flexibility.

提交回复
热议问题