Not able to convert the string to date on Android

前端 未结 2 768
南方客
南方客 2021-01-26 09:58

I have obtained a string from an API in form of 2017-04-23T19:47:39+00:00 How do i convert it into date of format \"2017-04-23T19:47:39-0000\"?

I tried the following but

2条回答
  •  故里飘歌
    2021-01-26 10:18

    Possibly you could try to set the locale,

    SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy", Locale.US);
    

提交回复
热议问题