import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.util.Locale;

public class FormatLokal {
    public static void main(String[] args) {
        LocalDate tanggal = LocalDate.of(2026, 1, 15);
        LocalDateTime rapat = LocalDateTime.of(2026, 1, 15, 8, 5);
        LocalTime jam = LocalTime.of(8, 5);
        Locale id = Locale.forLanguageTag("id");
        Locale us = Locale.US;

        FormatStyle[] daftarGaya = {
                FormatStyle.FULL, FormatStyle.LONG, FormatStyle.MEDIUM, FormatStyle.SHORT
        };
        for (FormatStyle gaya : daftarGaya) {
            String hasilId = DateTimeFormatter.ofLocalizedDate(gaya).withLocale(id).format(tanggal);
            String hasilUs = DateTimeFormatter.ofLocalizedDate(gaya).withLocale(us).format(tanggal);
            System.out.println(gaya + " | id    : " + hasilId);
            System.out.println(gaya + " | en-US : " + hasilUs);
        }

        DateTimeFormatter waktuId = DateTimeFormatter.ofLocalizedTime(FormatStyle.MEDIUM).withLocale(id);
        DateTimeFormatter waktuUs = DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT).withLocale(us);
        System.out.println("waktu MEDIUM id    : " + jam.format(waktuId));
        System.out.println("waktu SHORT us     : " + jam.format(waktuUs));

        DateTimeFormatter lengkap =
                DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withLocale(id);
        System.out.println("tanggal+waktu id   : " + rapat.format(lengkap));
    }
}
