DateTime
No edit summary
(Automatically adding template at the end of the page.)
 
(One intermediate revision by the same user not shown)
Line 13: Line 13:
It will return true for an empty but not nullable DateTime variable.  
It will return true for an empty but not nullable DateTime variable.  
[[Category:OCL]]
[[Category:OCL]]
{{Edited|July|12|2024}}

Latest revision as of 15:29, 10 February 2024

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

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

You can create a value using - 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.

This page was edited 97 days ago on 02/10/2024. What links here