Skip to content

Commit 12958b5

Browse files
committed
Added utility to format datetime string
1 parent cc6d7e2 commit 12958b5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Utilities/Utility.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,13 @@ public static double StringToDouble(string input)
12571257
return output;
12581258
}
12591259
#endregion
1260+
1261+
#region DateTime? to String
1262+
public static string NullableDateTimeToString(this DateTime? dt, string format)
1263+
{
1264+
return dt == null ? "" : ((DateTime)dt).ToString(format);
1265+
}
1266+
#endregion
12601267
}
12611268

12621269
/// <summary>

0 commit comments

Comments
 (0)