From 1047677b879e20ebd646e7a32fc87007fe0d84f0 Mon Sep 17 00:00:00 2001 From: Ivan Bereziuk Date: Thu, 22 Jan 2026 12:22:42 +0100 Subject: [PATCH] change timestamp format to ISO 8601 --- src/hotspot/share/services/diagnosticFramework.cpp | 7 +------ test/jdk/sun/tools/jcmd/TestJcmdTimestamp.java | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/hotspot/share/services/diagnosticFramework.cpp b/src/hotspot/share/services/diagnosticFramework.cpp index a97339df470..0edea41972f 100644 --- a/src/hotspot/share/services/diagnosticFramework.cpp +++ b/src/hotspot/share/services/diagnosticFramework.cpp @@ -417,11 +417,6 @@ static JcmdOptions parse_common_options(const CmdLine& line, stringStream *updat } -static void print_local_time(outputStream* output) { - char buf[32]; - output->print_cr("%s", os::local_time_string(buf, sizeof(buf))); -} - void DCmd::Executor::parse_and_execute(const char* cmdline, char delim, TRAPS) { if (cmdline == nullptr) return; // Nothing to do! @@ -470,7 +465,7 @@ void DCmd::Executor::parse_and_execute(const char* cmdline, char delim, TRAPS) { command->parse(&line, delim, CHECK); if (options.timestamp) { - print_local_time(_out); + _out->date_stamp(true, "", "\n"); } execute(command, CHECK); diff --git a/test/jdk/sun/tools/jcmd/TestJcmdTimestamp.java b/test/jdk/sun/tools/jcmd/TestJcmdTimestamp.java index 9a19ab72e84..35d396495ef 100644 --- a/test/jdk/sun/tools/jcmd/TestJcmdTimestamp.java +++ b/test/jdk/sun/tools/jcmd/TestJcmdTimestamp.java @@ -33,7 +33,7 @@ import jdk.test.lib.process.OutputAnalyzer; /* * @test - * @summary test jcmd generic flag "-t" to make sure dignostic coommand is timestamped + * @summary test whether jcmd generic flag "-t" adds a timestamp to the output * @library /test/lib * @run main/othervm TestJcmdTimestamp */