I came across an exercise in which the AM / PM format date should be converted to military format (24h).
So, suppose the user types 07:05:45 PM, the program should return 19:05:45.
I do not like looking for solutions on the internet, but I had no idea how to solve this problem and I came across the following solution:
Console.WriteLine(DateTime.Parse(Console.ReadLine()).ToString("HH:mm:ss"));
Even searching the internet, I could not understand how this method works. Could you explain?