Java Get Current Date for a Specific Time Zone

In order to get the Date in Java for a specific TimeZone, you can make use of the LocalDate class from the Date-Time API and pass in the ZoneId for the timezone in the static now method.

import java.time.LocalDate;
import java.time.ZoneId;

public class GetDateTimeZoned {

    public static void main(String[] args) {
        LocalDate dateInChicago ="America/Chicago"));
        LocalDate dateInMumbai ="Asia/Kolkata"));
        LocalDate dateInTokyo ="Asia/Tokyo"));
        LocalDate dateInLondon ="Europe/London"));

        System.out.println("Date in Chicago " + dateInChicago);
        System.out.println("Date in Mumbai: " + dateInMumbai);
        System.out.println("Date in Tokyo: " + dateInTokyo);
        System.out.println("Date in London: " + dateInLondon);



Date based on Time Zone Example Java

Make sure to pass in the correct timezone String or else you will get ZoneRulesException: Unknown time-zone exception.

You can find the complete list of TimeZone on this reference page: Time Zone and Off-Set List


Have Questions? Post them here!