import java.time.LocalDate;
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Locale;

public class Main {
	public static void main(String[] args) {
		String strDateTime = "2021-09-10T00:37:42Z";
		ZonedDateTime zdt = ZonedDateTime.parse(strDateTime);

		ZonedDateTime zdtLosAngeles = zdt.withZoneSameInstant(ZoneId.of("America/Los_Angeles"));

		LocalTime time = zdtLosAngeles.toLocalTime();
		LocalDate date = zdtLosAngeles.toLocalDate();
		System.out.println(time);
		System.out.println(date);

		// #########Custom formats #########

		DateTimeFormatter dtfDate = DateTimeFormatter.ofPattern("MM/dd/uuuu", Locale.ENGLISH);
		String formattedDateString = date.format(dtfDate);
		System.out.println(formattedDateString);

		DateTimeFormatter dtfTime = DateTimeFormatter.ofPattern("hh:mm a", Locale.ENGLISH);
		String formattedTimeString = time.format(dtfTime);
		System.out.println(formattedTimeString);
	}
}