viernes, 29 de abril de 2016

Get Current Timestamp in Java

Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy h:mm:ss a");
String formattedDate = sdf.format(date);
System.out.println(formattedDate); // 12/01/2011 4:48:16 PM

No hay comentarios:

Publicar un comentario