asp.net core the value cannot be converted to nullable datetime code example
Example: c# convert to nullable datetime
DateTime? lastPostDate = (DateTime?)(reader.IsDbNull(3) ? null : reader[3]);
DateTime? lastPostDate = (DateTime?)(reader.IsDbNull(3) ? null : reader[3]);