Run ❯
Get your
own Java
server
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Change Language
Go to Spaces
Ctrl+Alt+P
import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; public class Main { public static void main(String[] args) { LocalDateTime myDateObj = LocalDateTime.of(2026, 1, 15, 14, 30); DateTimeFormatter format1 = DateTimeFormatter.ofPattern("dd/MM/yyyy"); DateTimeFormatter format2 = DateTimeFormatter.ofPattern("HH:mm:ss"); System.out.println(myDateObj.format(format1)); System.out.println(myDateObj.format(format2)); } }
15/01/2026
14:30:00