mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-14 20:25:01 +00:00
Removing Utils directory to better match namespaces
This commit is contained in:
24
ICD.Common.Utils/Extensions/DateTimeExtensions.cs
Normal file
24
ICD.Common.Utils/Extensions/DateTimeExtensions.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user