Wha would be the equivalent in Java for this C# code:
DateTime.Now.TimeOfDay //This
DateTime.Now.ToString("h:mm:ss tt") //Or This
I'm finding a lot of things, some of them may be deprecated because it has 2 years or more, others are really complex for such a simple thing, and I'm sure there is a simpler way to do so.
I tried:
import java.util.Date;
Date d = new Date();
System.out.println(d); //Result: Wed Oct 28 00:46:29 2015
If I try:
System.out.println(d.getTime()); //Result: 1446000426285
I need to get only time: H:mm:ss