🚀 Welcome to MDriven Learn –  Don’t miss the latest Release Notes.
DateTime

DateTime.Now returns the current date and time.

To create a Datetime for a specific date, use:

DateTime.Parse('2020-01-01')

or

DateTime.Create(2020, 1, 1)
Empty DateTime that is not nullable

For a DateTime that is not nullable, i.e. a DateTime, not a DateTime?, what value does it have without a date?

You can create a value using the following, which will be empty:

DateTime.Create(1, 1, 1)

You can also compare an empty DateTime value with this empty DateTime value like this:

vDateTimeValue = DateTime.Create(1, 1, 1) 

It will return true for an empty but not nullable DateTime variable.