0800 => 8:00 AM
2317 =>晚上11:17
DateTime dt = DateTime.ParseExact("0800","HHmm",CultureInfo.InvariantCulture); string timestring = dt.ToString("h:mm tt");
有关格式代码,请参阅documentation.