How to convert Timestamp into Date format in java

后端 未结 4 543
日久生厌
日久生厌 2020-12-22 15:41

I have a time stamp like this(form a json response) :

\"/Date(1479974400000-0800)/\"

I\'m trying this function to convert time stamp into date:



        
4条回答
  •  执念已碎
    2020-12-22 16:04

    If by date you mean Date instance, then you can do this:

    new Date(Long.parseLong("\/Date(1479974400000-0800)\/".substring(7, 20)));
    

提交回复
热议问题