fork download
  1. import java.time.LocalDateTime;
  2. import java.time.format.DateTimeFormatter;
  3. import java.util.Locale;
  4.  
  5. public class Main {
  6. public static void main(String[] args) {
  7. // This is a dummy LocalDateTime for the purpose of demo. You will retrieve
  8. // LocalDateTime from the DB as shown above
  9. LocalDateTime ldt = LocalDateTime.now();
  10. DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd.MM.uuuu", Locale.ENGLISH);
  11. String formatted = ldt.format(dtf);
  12. System.out.println(formatted);
  13. }
  14. }
Success #stdin #stdout 0.08s 51300KB
stdin
Standard input is empty
stdout
29.10.2021