From 5853a2c00983028bab684241f428820587186a4e Mon Sep 17 00:00:00 2001 From: Erik Gahlin Date: Thu, 18 Apr 2024 11:59:57 +0000 Subject: [PATCH] 8330533: JFR: LocalDateTime should not use milliseconds since epoch Reviewed-by: aturbanov, mgronlun --- src/jdk.jfr/share/classes/jdk/jfr/internal/Repository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/Repository.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/Repository.java index 5fe95d179e4..ff09d58a9c0 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/Repository.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/Repository.java @@ -109,7 +109,7 @@ public final class Repository { return LocalDateTime.now(); } catch (DateTimeException d) { Logger.log(LogTag.JFR, LogLevel.INFO, "Could not create LocalDateTime with the default time zone. Using UTC time zone for chunk filename."); - return LocalDateTime.ofEpochSecond(System.currentTimeMillis(), 0, ZoneOffset.UTC); + return LocalDateTime.now(ZoneOffset.UTC); } }