DateTime? dt = null;
Nullable<DateTime> dt = null;
Occasional rantings about Dynamics CRM/365, Power BI and Azure cloud. Taking the first small steps in machine learning, Python and algorithmic trading
Thursday, August 01, 2019
Code tip: Nullable datetime in C#
Nullable types are used when you need to represent the value of an underlying type. By default DateTime is not nullable in C# because it is a Value type, but using the Nullable construct (or the ? shorthand), you can assign the null literal to the DateTime type. Syntax is below:
Labels:
C#,
development,
microsoft,
programming
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment