I need to get the current timestamp in Java, with the format MM/DD/YYYY h:mm:ss AM/PM ,
For example: 06/01/2000 10:01:50 AM
I also need to be Threadsafe.
Can I use something like this?
java.util.Date date = new java.util.Date(); System.out.println(new Timestamp(date.getTime()));
Or the examples discussed by reference here .
java datetime timestamp format
user717236 Dec 01 '11 at 16:45 2011-12-01 16:45
source share