15 lines
392 B
C#
15 lines
392 B
C#
namespace Indotalent.ConfigBackEnd.Extensions;
|
|
|
|
public static class DateTimeExtensions
|
|
{
|
|
private const string DefaultFormat = "dd MMM yyyy, HH:mm";
|
|
|
|
public static string ToString(this DateTimeOffset? dateTimeOffset, string format = DefaultFormat)
|
|
{
|
|
if (!dateTimeOffset.HasValue) return "-";
|
|
|
|
return dateTimeOffset.Value.ToLocalTime().ToString(format);
|
|
}
|
|
|
|
}
|