You are viewing a single comment's thread. Return to all comments →
C#
string am = "AM"; string pm = "PM";
if (s.Contains(am)) { if (s[0] == '1' && s[1] == '2') { string newTwentyFourStart = "00"; return newTwentyFourStart + s.Substring(2, 6); } return s.Remove(8,2); } else { if (s[0] == '1' && s[1] == '2') { return s.Remove(8,2); } string newTwentyFourStart = (int.Parse(s.Substring(0,2))+12).ToString(); return newTwentyFourStart + s.Substring(2, 6); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Time Conversion
You are viewing a single comment's thread. Return to all comments →
C#