tags:

views:

63

answers:

2

How can I retrieve the time portion of a date?

Date date = new Date();
SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
System.out.println(dateFormat(date));
+1  A: 
Date date = new Date();
SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
String time = dateFormat.format(date)
Slava Nadvorny
A: 

You won't believe:

String result = dateFormat.format(date);
folone