ZonedDateTime
represents a date and time with a time-zone in the ISO-8601 calendar system. It is ideal for global applications where you must consider time zones and daylight saving time.
Commonly Used Methods

Simple Program
import java.time.ZonedDateTime; import java.time.ZoneId; public class SimpleZonedDateTimeExample { public static void main(String[] args) { ZonedDateTime currentSystemTime = ZonedDateTime.now(); ZonedDateTime newYorkTime = ZonedDateTime.now(ZoneId.of("America/New_York")); System.out.println("System Default Zone Time: " + currentSystemTime); System.out.println("New York Time: " + newYorkTime); } }
LotusJavaPrince and Mahesh are working on a global conference scheduler. Users from different countries submit their local meeting times, and the system must convert and display those times in the time zones of participants from different countries.
Task is to:
- Accept a meeting time and zone from the host (e.g.,
2025-08-15 10:00 Asia/Tokyo
). - Convert and show the same meeting time in the time zones of participants (e.g.,
America/New_York
,Europe/London
, andAsia/Kolkata
).
import java.time.ZonedDateTime; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.time.ZoneId; import java.util.Scanner; public class GlobalMeetingScheduler { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); System.out.print("Enter meeting date and time (yyyy-MM-dd HH:mm): "); String dateTimeInput = scanner.nextLine(); System.out.print("Enter host time zone (e.g., Asia/Tokyo): "); String hostZoneInput = scanner.nextLine(); try { LocalDateTime localDateTime = LocalDateTime.parse(dateTimeInput, formatter); ZoneId hostZone = ZoneId.of(hostZoneInput); ZonedDateTime hostZonedDateTime = ZonedDateTime.of(localDateTime, hostZone); // Convert to other time zones ZonedDateTime nyTime = hostZonedDateTime.withZoneSameInstant(ZoneId.of("America/New_York")); ZonedDateTime londonTime = hostZonedDateTime.withZoneSameInstant(ZoneId.of("Europe/London")); ZonedDateTime indiaTime = hostZonedDateTime.withZoneSameInstant(ZoneId.of("Asia/Kolkata")); System.out.println("\n--- Meeting Schedule ---"); System.out.println("Host Time (" + hostZone + "): " + hostZonedDateTime.format(formatter)); System.out.println("New York Time: " + nyTime.format(formatter)); System.out.println("London Time: " + londonTime.format(formatter)); System.out.println("India Time: " + indiaTime.format(formatter)); } catch (Exception e) { System.out.println("Invalid input. Please check date/time and zone format."); } scanner.close(); } } /* Enter meeting date and time (yyyy-MM-dd HH:mm): 2025-08-15 10:00 Enter host time zone (e.g., Asia/Tokyo): Asia/Tokyo --- Meeting Schedule --- Host Time (Asia/Tokyo): 2025-08-15 10:00 New York Time: 2025-08-14 21:00 London Time: 2025-08-15 02:00 India Time: 2025-08-15 06:30 */