Java tutorial
import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; public class Main { public static void main(String[] args) { String DATE_FORMAT = "dd/MM/yyyy HH:mm:ss"; LocalDateTime ldt = LocalDateTime.now(); DateTimeFormatter dtf = DateTimeFormatter.ofPattern(DATE_FORMAT); System.out.println(ldt.format(dtf)); } }