Retrieve time portion of date [closed]
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));
Date date = new Date();
SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
String time = dateFormat.format(date)
You won't believe:
String result = dateFormat.format(date);
精彩评论