From ba2d180ffa7dc63d1763f63a8ba06f1bf4190faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9?= Date: Wed, 24 Jun 2026 14:58:01 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=B0=D1=82=D0=B0=20=D0=B8=20=D0=B2?= =?UTF-8?q?=D1=80=D0=B5=D0=BC=D1=8F=20=D1=82=D0=B0=D0=B9=D0=BC=D0=B7=D0=BE?= =?UTF-8?q?=D0=BD=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/TaskDemo.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/TaskDemo.java b/src/TaskDemo.java index a1c8959..1cb5a1b 100644 --- a/src/TaskDemo.java +++ b/src/TaskDemo.java @@ -1,15 +1,17 @@ +import java.time.*; +import java.time.format.DateTimeFormatter; import java.util.ArrayList; public class TaskDemo { public static void main(String[] args) { - try { - // throw new IllegalArgumentException("Неверный формат данных"); - } catch (IllegalArgumentException e) { - System.out.println("Сработал перехват, Сообщение: " + e.getMessage()); - } finally { - U.pl("Завершение операции"); - } + ZoneId tokyoZone = ZoneId.of("Asia/Tokyo"); + + ZonedDateTime tokyoTime = ZonedDateTime.now(tokyoZone); + + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + String uiText = tokyoTime.format(formatter); + System.out.println("Точное время в Токио: " + uiText); } }