Skip to content

Convert DateTime? to DateTime

To convert a nullable DateTime back to a normal DateTime, you can use the null coalescing operator:

DateTime? nullableDateTime = null;
DateTime normalDateTime = nullableDateTime ?? DateTime.Now


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.