mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
25 lines
599 B
C#
25 lines
599 B
C#
using System;
|
|
|
|
namespace ICD.Common.Utils.Extensions
|
|
{
|
|
/// <summary>
|
|
/// Extension methods for DateTime.
|
|
/// </summary>
|
|
public static class DateTimeExtensions
|
|
{
|
|
/// <summary>
|
|
/// Gets a string representation of the DateTime with millisecond precision.
|
|
/// </summary>
|
|
/// <param name="extends"></param>
|
|
/// <returns></returns>
|
|
public static string ToLongTimeStringWithMilliseconds(this DateTime extends)
|
|
{
|
|
if (extends == null)
|
|
throw new ArgumentNullException("extends");
|
|
|
|
// Todo - Better handle different cultures
|
|
return extends.ToString("HH:mm:ss:fff");
|
|
}
|
|
}
|
|
}
|