Asked • 04/29/19

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?

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.