G
G
Gibbon Cho2014-07-24 08:41:36
Java
Gibbon Cho, 2014-07-24 08:41:36

how to convert timestamp to date in java

Good day! I am new to java. I can't find a solution specifically for my problem.
There is a String in which there is a timestamp ("1406050791" for example).
You need to convert it (preferably to String) into a readable form like "dd.MM.yyyy HH:mm".
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Vanin, 2014-07-24
@jask

I would do it this way

E
Evgeny Khabarov, 2014-07-28
@ehabarov

The "optimized" version of the option suggested by jack
Calendar is IMHO redundant, java.util.Date is sufficient.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question