Convert timestamp into date format Java

Hi,
I want to change a timestamp value into a date format (yyyy-mm-dd hh:MM:ss).
Please suggest.
parveendalalAsked:
Who is Participating?
 
objectsConnect With a Mentor Commented:
timastamp is a subclass of Date so you can format it the same way as you would a date

http://helpdesk.objects.com.au/java/how-do-i-format-a-date-as-a-string
0
 
CEHJCommented:
Try


DateFormat df = new SimpleDateFormat("yyyy-mm-dd hh:MM:ss");
String s = df.format(new Date(ts.getTime()));

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.