DateTime.Now on Safari/Mac
System.DateTime.Now returns a different time in Blazor than "regular dotNET".
------- ASPNET CORE
PS /Users/warddurossette/Projects/FirstCoreWebApp> dotnet --version 2.1.4
CODE:
await context.Response.WriteAsync($"Hello Ward! The current time is: {System.DateTime.Now}");
OUTPUT:
Hello Ward! The current time is: 02/12/2018 20:14:43
------- BLAZOR
CODE:
Hello, world!
The current time is: @System.DateTime.Now
OUTPUT: Hello, world! The current time is: 02/13/2018 02:14:43
Interesting... Looks like 1 is UTC and the other is UTC +- 6 ...
@muqeet-khan yes, thanks, I should have mentioned that. I am CST here in Texas, that's exactly what it is. The Blazor flavor is displaying UTC, default dotNET behavior shows local time zone. Currently Central Standard Time (CST) is -6 from UTC.
I did see another issue asking for localization, and suspect this is a symptom of not being localized.
Thanks for reporting this. I think we should consider it a duplicate of aspnet/AspNetCore#5471.
One thing to note about localization - I watched @csharpfritz do a live demo of Blazor and on the Windows platform DateTime.Now displayed the correct time. The UTC display only occurs on the Mac; I am thinking because of the funny way *unix does system clock time compared windows.