Parse JSON in UNIX date in Java/Android without any library

前端 未结 3 1158
鱼传尺愫
鱼传尺愫 2021-01-07 12:39

I have a JSON array received from my server. I obtain a date as a timestamp String – for example, [{\"date\": \"1418056895\", ... }] – and I need to

3条回答
  •  走了就别回头了
    2021-01-07 13:38

    I don't really understand what you are trying to ask here. But if you're asking is to ow to convert that date that you get in human readable form then you should take a look at Epoch Converter. The date is returned to you in epoch timestamp. You can convert the same to a human readable form n java by using the following code.

    String date = new java.text.SimpleDateFormat("MM/dd/yyyy HH:mm:ss").format(new java.util.Date (epoch*1000));
    

提交回复
热议问题