using System;
using System.Globalization;
public class Test
{
public static void Main()
{
string data1 = "01/08/2016 9:00 AM";
string data2 = "01/08/2016 9:00 PM";
DateTime dataOut;
if(DateTime.TryParse(data1, out dataOut))
{
Console.WriteLine(dataOut.ToString("HH:mm ", CultureInfo.InvariantCulture));
}
if(DateTime.TryParse(data2, out dataOut))
{
Console.WriteLine(dataOut.ToString("HH:mm ", CultureInfo.InvariantCulture));
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uR2xvYmFsaXphdGlvbjsKCnB1YmxpYyBjbGFzcyBUZXN0CnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKCXsKCQlzdHJpbmcgZGF0YTEgPSAiMDEvMDgvMjAxNiA5OjAwIEFNIjsKCQlzdHJpbmcgZGF0YTIgPSAiMDEvMDgvMjAxNiA5OjAwIFBNIjsKCQkKCQlEYXRlVGltZSBkYXRhT3V0OwoJCQoJCWlmKERhdGVUaW1lLlRyeVBhcnNlKGRhdGExLCBvdXQgZGF0YU91dCkpCgkJewoJCQlDb25zb2xlLldyaXRlTGluZShkYXRhT3V0LlRvU3RyaW5nKCJISDptbSAiLCBDdWx0dXJlSW5mby5JbnZhcmlhbnRDdWx0dXJlKSk7CgkJfQoJCQoJCWlmKERhdGVUaW1lLlRyeVBhcnNlKGRhdGEyLCBvdXQgZGF0YU91dCkpCgkJewoJCQlDb25zb2xlLldyaXRlTGluZShkYXRhT3V0LlRvU3RyaW5nKCJISDptbSAiLCBDdWx0dXJlSW5mby5JbnZhcmlhbnRDdWx0dXJlKSk7CgkJfQoJfQp9