See this page for each way you might want to format DateTime .
Please note that you use "HH" for 24-hour time.
For example, if you want the format β23:00:00β instead of β11:00:00 PMβ, you should use:
string formatted = dt_calc.ToString("HH:mm:ss");
By the way, your initializing your DateTime values ββwith new DateTime() not needed.
source share