Java tutorial
import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; public class Main { public static void main(String[] args) { ZonedDateTime dateTime = ZonedDateTime.from(ZonedDateTime.now()); String s = dateTime.format(DateTimeFormatter.ISO_DATE_TIME); System.out.println(s); } }