[Solved] How to get date and time in below format in java? [closed]


Your answer should look something like this:

String dateTimePattern = "dd-MM-yyyy HH:mm a";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(dateTimePattern );
LocalDateTime yourDay= LocalDateTime.of(2020, 4, 6, 17, 00);
System.out.println(formatter.format(ZonedDateTime.of(yourDay, ZoneId.of("UTC-5"))));

Please look this up for more info on the available formats.

7

solved How to get date and time in below format in java? [closed]