I've got the following String format: "26/10/2017 22:54:22"
im trying to convert it to DateTime object, which should be of the same format as the string (24hours format) but somewhy it generates a 12h format.
my code:
var time = "26/10/2017 22:54:22";
DateTime convertedDate = DateTime.ParseExact(time, "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture);
Console.WriteLine(convertedDate);
Console.ReadLine();
the output i get is: 10/26/2017 10:54:22 PM
any ideas why is that?