Java Converting 19-digit Unix Timestamp to a Readable Date

后端 未结 3 2100
旧时难觅i
旧时难觅i 2021-01-26 11:26

I am trying to convert 19 digit Unix timestamp such as 1558439504711000000 (one and a half quintillion) into a readable date/time format. My timestamp ends with 6 z

3条回答
  •  广开言路
    2021-01-26 12:10

    Try using this

    Date date = new java.util.Date(timeStamp/1000000); 
    

    Instead of multiplying by 1000, divide by 1000000

提交回复
热议问题