I want to trip/remove seconds from date time. I checked some solution but showing solution using format string like
DateTime datetime = DateTime.UtcNow;
DateTime time = DateTime.Now; string timestring = time.ToString("g");
ToString("g") will convert DateTime to string and remove seconds.
ToString("g")
DateTime
Output: 03/29/2018 11:11 PM
03/29/2018 11:11 PM