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