LANCommander/LANCommander.Client/Extensions/TimeSpanExtensions.cs

20 lines
475 B
C#
Raw Permalink Normal View History

2024-06-08 23:38:55 -05:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LANCommander.Client.Extensions
{
public static class TimeSpanExtensions
{
public static string ToShortTime(this TimeSpan timeSpan)
{
if (timeSpan.TotalHours >= 1)
2024-06-09 01:49:47 -05:00
return timeSpan.ToString("hh\\:mm\\:ss");
2024-06-08 23:38:55 -05:00
else
2024-06-09 01:49:47 -05:00
return timeSpan.ToString("mm\\:ss");
2024-06-08 23:38:55 -05:00
}
}
}