Scenario:
I'm migrating a WebAPI to .NET Core, in Windows it's running normally.
Problem
When I'm running on Docker (Linux) (docker-compose) I'm having the following problem:
"The time zone ID 'W. Europe Standard Time' was not found on the local computer. "
Code where it occurs:
public static DateTime ConvertDateToLanguage(DateTime dDateLocal)
{
var sqlServerRepository = new SqlServerRepository();
var cstZone =
TimeZoneInfo.FindSystemTimeZoneById(
sqlServerRepository.GetImpostazioniSkin().FirstOrDefault()?.FusoOrario ?? string.Empty);
var cstTime = TimeZoneInfo.ConvertTimeFromUtc(dDateLocal.ToUniversalTime(), cstZone);
return cstTime;
}