how to increase time by 15 mins using c#

If you want to format your output to give you only time part. Change your write to:

Console.WriteLine(startTime.ToString("HH:mm:ss"));

you can read more on formatting strings here: https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings

Leave a Comment