I have a timezoneinfo Central Europe Standard Time, which is showing UTC +01:00, when i execute the code it shows 2 hrs before time instead of 1 hr. Below is the sample code
static void Main(string[] args)
{
var strTimeZoneInfo = "Central Europe Standard Time";
var datetimeDST = Convert.ToDateTime("2019-07-18 18:17:00");
var timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(strTimeZoneInfo);
var dtUTC= TimeZoneInfo.ConvertTimeToUtc(datetimeDST, timeZoneInfo);
Console.WriteLine(Convert.ToString(dtUTC));
Console.ReadKey();
}
So instead of 2019-07-18 17:17:00 i am getting 2019-07-18 16:17:00. Can someone explain how to resolve this without using Noda or other external library.
Referred Below links but not clear how to resolve this problem.
- UTC converted to Central Europe Standard Time is 2 hours in front not 1
- Is there a generic TimeZoneInfo For Central Europe?
Also referred this link's answer but it's not working.