string[] dateStrings = new[]{"15.01.2019 10:00","20.05.2020 20:00","07.07.2019 23:05"};
string format = "dd.MM.yyyy HH:mm";
string outFormat = "yyyy/MM/dd HH:mm:ss";
foreach(string dateString in dateStrings){
try {
DateTime result = DateTime.ParseExact(dateString, format, System.Globalization.CultureInfo.InvariantCulture);
project.SendInfoToLog(string.Format(@"До: {0} После: {1}",dateString, result.ToString(outFormat)));
}
catch (FormatException) {
project.SendWarningToLog(string.Format(@"Дата не корректная. Вход: {0}",dateString));
}
}