Let’s say I have a task execute. I want to know according to the system clock/time when that finished executing. Is there something in Java I can use to pull the current system time and display it in Java? I’m not looking to measure time like using Millis or Nano (that would only tell me how many milliseconds, not the actual time or date), but actually print the time finished (like “Finished at 9:42 P.M. 10/14/2012” as per my actual Windows time).
Share
A quick Google search finds this: http://www.mkyong.com/java/java-how-to-get-current-date-time-date-and-calender/
Just make sure you import java.util and java.text, and you should be good to go.