Java: Date from unix timestamp
I need to convert a unix timestamp to a date object. I tried this: java.util.Date time = new java.util.Date(timeStamp); Timestamp value is: 1280512800 The Date should be “2010/07/30 – 22:30:00” (as I get it by PHP) but instead I get Thu Jan 15 23:11:56 IRST 1970. How should it be done? 10 Answers 10