.NET Core 3.1 - Странное поведение TimeZoneInfo.ConvertTime под Linux
От: senglory  
Дата: 17.07.21 22:35
Оценка:
            try
            {
                return TimeZoneInfo.ConvertTime(dateTime, sourceTimeZone, destinationTimeZone);
            }
            catch (ArgumentException innerException)
            {
                throw new TimeZoneConversionException(string.Format("Unable to convert {0} from {1} to {2}.", DateTimeToXSDateTime(dateTime), sourceTimeZone.DisplayName, destinationTimeZone.DisplayName), innerException);
            }


Вылетаю в catch c таким исключением:

Microsoft.Exchange.WebServices.Data.TimeZoneConversionException: Unable to convert 1981-04-01T00:00:00.000 from (UTC+03:00) Москва, стандартное время to (UTC) Coordinated Universal Time.
---> System.ArgumentException: The supplied DateTime represents an invalid time. For example, when the clock is adjusted forward, any time in the period that is skipped is invalid. (Parameter 'dateTime')



Что ему от меня надо?
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.