From 3f3d194689a21a81325240a3810e3dc6956bb81c Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 16 Feb 2022 10:19:54 +0000 Subject: [PATCH] improve performance of time zone lookup git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898125 13f79535-47bb-0310-9956-ffa450edef68 --- poi/src/main/java/org/apache/poi/ss/usermodel/DateUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/DateUtil.java b/poi/src/main/java/org/apache/poi/ss/usermodel/DateUtil.java index 7a50951ac7..154127a50c 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/DateUtil.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/DateUtil.java @@ -93,7 +93,7 @@ public class DateUtil { */ public static LocalDateTime toLocalDateTime(Date date) { return date.toInstant() - .atZone(TimeZone.getTimeZone(ZoneOffset.UTC).toZoneId()) // java.util.Date uses UTC + .atZone(LocaleUtil.TIMEZONE_UTC.toZoneId()) // java.util.Date uses UTC .toLocalDateTime(); } @@ -104,7 +104,7 @@ public class DateUtil { */ public static LocalDateTime toLocalDateTime(Calendar date) { return date.toInstant() - .atZone(TimeZone.getTimeZone(ZoneOffset.UTC).toZoneId()) // java.util.Date uses UTC + .atZone(LocaleUtil.TIMEZONE_UTC.toZoneId()) // java.util.Date uses UTC .toLocalDateTime(); } -- 2.39.5