The task for the condition to work according to the convertible time
the code
StartMaxVol = DateTime.Parse("10:00", System.Globalization.CultureInfo.InvariantCulture) ;
EndMaxVol = DateTime.Parse("22:00", System.Globalization.CultureInfo.InvariantCulture) ;
TM = "Eastern Standard Time";
// TIME CONVERTED
DateTime ExchangeDateTime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTim e.Now, (TM));
if (!UseTime || ExchangeDateTime >= StartMaxVol && ExchangeDateTime <= EndMaxVol)
{
// LOGIC
}

Comment