Problem Statement
|
Timestamp = DateTimeOffset.UtcNow.ToString("dd MMM yyyy, HH:mm:ss 'UTC'"), |
Currently, DateTimeOffset.UtcNow.ToString("dd MMM yyyy, HH:mm:ss 'UTC'") is used as a fixed date format.
However, dd MMM yyyy is an English-oriented format and often does not fit other languages well. For example, in Japanese it becomes something like 08 5月 2026, 17:40:20 UTC, which is very unnatural as a Japanese DateTime representation.
If using the "dd MMM yyyy, HH:mm:ss 'UTC'" format, I think InvariantCulture should be specified.
Proposed Solution
Change the places using DateTimeOffset.UtcNow.ToString("dd MMM yyyy, HH:mm:ss 'UTC'") to something like the following.
DateTimeOffset.UtcNow.ToString("dd MMM yyyy, HH:mm:ss 'UTC'", CultureInfo.CurrentCulture.DateTimeFormat.FullDateTimePattern, CultureInfo.InvariantCulture)
Alternatives Considered
It might be better to use a culture-dependent format instead. In that case, it would probably make more sense to display the time in local time rather than UTC.
DateTimeOffset.Now.ToString(CultureInfo.CurrentCulture.DateTimeFormat.FullDateTimePattern)
DateTimeOffset.Now.ToString($"{CultureInfo.InvariantCulture.DateTimeFormat.LongDatePattern} {CultureInfo.InvariantCulture.DateTimeFormat.LongTimePattern}")
DateTimeOffset.Now.ToString($"{CultureInfo.InvariantCulture.DateTimeFormat.ShortDatePattern} {CultureInfo.InvariantCulture.DateTimeFormat.LongTimePattern}")
Feature Category
Test Output / Reporting
How important is this feature to you?
None
Additional Context
No response
Contribution
Problem Statement
TUnit/TUnit.Engine/Reporters/Html/HtmlReporter.cs
Line 367 in 46029b7
Currently,
DateTimeOffset.UtcNow.ToString("dd MMM yyyy, HH:mm:ss 'UTC'")is used as a fixed date format.However,
dd MMM yyyyis an English-oriented format and often does not fit other languages well. For example, in Japanese it becomes something like08 5月 2026, 17:40:20 UTC, which is very unnatural as a Japanese DateTime representation.If using the
"dd MMM yyyy, HH:mm:ss 'UTC'"format, I thinkInvariantCultureshould be specified.Proposed Solution
Change the places using
DateTimeOffset.UtcNow.ToString("dd MMM yyyy, HH:mm:ss 'UTC'")to something like the following.DateTimeOffset.UtcNow.ToString("dd MMM yyyy, HH:mm:ss 'UTC'", CultureInfo.CurrentCulture.DateTimeFormat.FullDateTimePattern, CultureInfo.InvariantCulture)Alternatives Considered
It might be better to use a culture-dependent format instead. In that case, it would probably make more sense to display the time in local time rather than UTC.
DateTimeOffset.Now.ToString(CultureInfo.CurrentCulture.DateTimeFormat.FullDateTimePattern)DateTimeOffset.Now.ToString($"{CultureInfo.InvariantCulture.DateTimeFormat.LongDatePattern} {CultureInfo.InvariantCulture.DateTimeFormat.LongTimePattern}")DateTimeOffset.Now.ToString($"{CultureInfo.InvariantCulture.DateTimeFormat.ShortDatePattern} {CultureInfo.InvariantCulture.DateTimeFormat.LongTimePattern}")Feature Category
Test Output / Reporting
How important is this feature to you?
None
Additional Context
No response
Contribution