We have a MVC project and I need to display a UTC date converted to users local time. In my model I am passing the UTC date and in the view I am trying to do the following:<
In a .NET Core project, I finally had success with the following razor code:
@Model.DateUpdated.ToLocalTime().ToString( CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern + " " + CultureInfo.CurrentUICulture.DateTimeFormat.LongTimePattern)
(Inspiration taken from Kelly R's answer)