From 529bb23de3adc52067f1635476c1e963ba087c87 Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Sun, 29 Oct 2023 10:50:51 +0100 Subject: [PATCH] LogListener: be explicit about time zone --- java/org/contikios/cooja/plugins/LogListener.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/org/contikios/cooja/plugins/LogListener.java b/java/org/contikios/cooja/plugins/LogListener.java index a88e98a3c..5565623d5 100644 --- a/java/org/contikios/cooja/plugins/LogListener.java +++ b/java/org/contikios/cooja/plugins/LogListener.java @@ -51,6 +51,7 @@ import java.io.IOException; import java.io.PrintWriter; import java.nio.file.Files; +import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.util.ArrayList; @@ -838,7 +839,7 @@ public boolean appendToFile(File file, String text) { /* Append to file */ if (!appendToFileWroteHeader) { appendStream.println("-- Log Listener [" + simulation.getTitle() + "]: Started at " + - (ZonedDateTime.now().format(DateTimeFormatter.RFC_1123_DATE_TIME))); + (ZonedDateTime.now(ZoneId.systemDefault()).format(DateTimeFormatter.RFC_1123_DATE_TIME))); appendToFileWroteHeader = true; } appendStream.print(text);