Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public static String obtenerFechaYHoraActual() {
String formato = "yyyy-MM-dd HH:mm:ss";
DateTimeFormatter formateador = DateTimeFormatter.ofPattern(formato);
LocalDateTime ahora = LocalDateTime.now();
return formateador.format(ahora);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment