Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.util.Locale;

public class Main {

    public static void main(String[] args) {
        ZonedDateTime zonedDateTime = ZonedDateTime.of(2013, 1, 19, 0, 0, 0, 0, ZoneId.of("Europe/Paris"));

        DateTimeFormatter longDateTimeFormatter = DateTimeFormatter
                .ofLocalizedDateTime(FormatStyle.FULL, FormatStyle.FULL).withLocale(Locale.FRENCH);
        System.out.println(longDateTimeFormatter.getLocale()); // fr
        System.out.println(longDateTimeFormatter.format(zonedDateTime));

    }
}