convert am pm time to 24 hour c# code example Example: c# subtract 24 hours form datetime DateTime dt1 = dt.AddHours(-24);