Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
DateTimeExtensions.cs
2{
6 public static class DateTimeExtensions
7 {
13 public static DateTime? GetDateOrNullIfMinValue(this DateTime? date)
14 {
15 if (!date.HasValue)
16 return null;
17 return GetDateOrNullIfMinValue(date.Value);
18 }
19
25 public static DateTime? GetDateOrNullIfMinValue(this DateTime date)
26 {
27 if (date == DateTime.MinValue)
28 return null;
29 return date;
30 }
31 }
32}
Extensions for the DateTime class.
static ? DateTime GetDateOrNullIfMinValue(this DateTime date)
Returns the actual date if it has a valid value, or null if it is DateTime.MinValue.
static ? DateTime GetDateOrNullIfMinValue(this DateTime? date)
Returns the actual date, if it is non-null, or null if it is DateTime.MinValue.