Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion TUnit.Engine/Reporters/Html/HtmlReporter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Concurrent;
using System.Globalization;
using System.Net;
using System.Reflection;
using System.Runtime.InteropServices;
Expand Down Expand Up @@ -364,7 +365,7 @@ private ReportData BuildReportData()
{
AssemblyName = assemblyName,
MachineName = Environment.MachineName,
Timestamp = DateTimeOffset.UtcNow.ToString("dd MMM yyyy, HH:mm:ss 'UTC'"),
Timestamp = FormatTimestamp(DateTimeOffset.UtcNow),
TUnitVersion = tunitVersion,
OperatingSystem = RuntimeInformation.OSDescription,
RuntimeVersion = RuntimeInformation.FrameworkDescription,
Expand Down Expand Up @@ -414,6 +415,15 @@ private static (string? CommitSha, string? Branch, string? PullRequestNumber, st
return (commitSha, branch, prNumber, repoSlug);
}

private static string FormatTimestamp(DateTimeOffset value)
{
// Both 'R' and 'u' are culture-invariant by spec; branching is purely for English-reader aesthetics.
var utc = value.ToUniversalTime();
return CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "en"
? utc.ToString("R")
: utc.ToString("u");
}

private static void AccumulateStatus(ReportSummary summary, ReportTestResult testResult)
{
summary.Total++;
Expand Down
Loading