Question Detail

How to convert TimeStamp to Date in Java

5 years ago Views 1195 Visit Post Reply

In a scenario, i am getting a timestamp in my Date variable How to convert TImestamp to Date Format in java?

 


Thread Reply

Nick Johnson

- 5 years ago

here is the solution :

Timestamp stamp = new Timestamp("1511784709");
Date date = new Date(stamp.getTime());
System.out.println(date);