How can I parse UTC date/time (String) into something more readable?

前端 未结 10 872
深忆病人
深忆病人 2020-12-13 04:07

I have a String of a date and time like this: 2011-04-15T20:08:18Z. I don\'t know much about date/time formats, but I think, and correct me if I\'m wrong, that\

10条回答
  •  -上瘾入骨i
    2020-12-13 04:45

    You have to give the following format:

    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
    Date parse = simpleDateFormat.parse( "2011-04-15T20:08:18Z" );
    

提交回复
热议问题