Convert string in timestamp to date java

0

How to convert string in timestamp generated by php with the time () method generated for example: 1504541885 for Date in java

    
asked by anonymous 04.09.2017 / 18:23

1 answer

2

You can do this:

Integer timeStamp = Integer.Parse("1504541885");
Date time = new Date((long) timeStamp * 1000);
  • java.util.Date
  • 04.09.2017 / 18:31