initial commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user