I need to get the current timestamp in Java, with the format of MM/DD/YYYY h:mm:ss AM/PM,
MM/DD/YYYY h:mm:ss AM/PM
For example: 06/01/2000 10:01:50 AM
06/01/2000 10:01:50 AM
I ne
Try this single line solution :
import java.util.Date; String timestamp = new java.text.SimpleDateFormat("MM/dd/yyyy h:mm:ss a").format(new Date());