Skip to content

Instantly share code, notes, and snippets.

@philipmat
Last active October 10, 2023 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philipmat/bf714827b7a31b8d62ff41bec0b87b42 to your computer and use it in GitHub Desktop.
Save philipmat/bf714827b7a31b8d62ff41bec0b87b42 to your computer and use it in GitHub Desktop.
DotNet LongTimePattern
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
Console.WriteLine($".NET Version={Environment.Version}");
Console.WriteLine($"OS={System.Runtime.InteropServices.RuntimeInformation.OSDescription}");
Console.WriteLine($"Long Time Pattern={new System.Globalization.CultureInfo("en-US").DateTimeFormat.LongTimePattern}");
@philipmat
Copy link
Author

philipmat commented Oct 10, 2023

On MacOS Sonoma 14.0

❯ dotnet run
.NET Version=7.0.11
OS=Darwin 23.0.0 Darwin Kernel Version 23.0.0: Fri Sep 15 14:42:57 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T8112
Long Time Pattern=h:mm:sstt

On MacOS Ventura 13.6

❯ dotnet run
.NET Version=7.0.2
OS=Darwin 22.6.0 Darwin Kernel Version 22.6.0: Fri Sep 15 13:41:28 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_ARM64_T6000
Long Time Pattern=h:mm:ss tt

On Windows 10

❯ dotnet run
.NET Version=7.0.11
OS=Microsoft Windows 10.0.19045
Long Time Pattern=h:mm:ss tt

dotnet/runtime#93310

Seems to be fixed with .NET 8.0.100-rc.2.23502.2

❯ dotnet run
.NET Version=8.0.0
OS=Darwin 23.0.0 Darwin Kernel Version 23.0.0: Fri Sep 15 14:42:57 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T8112
Long Time Pattern=h:mm:ss tt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment