local dDate as date
local dResult as DateTime
local dResultN as Nullable<DateTime>
dDate := null_date
dResult := dDate
dResultN := dDate
System.Console.WriteLine( String.Format( "{0} gives {1} (DateTime) and {2} (Nullable<DateTime>)", dDate:ToString(), dResult:ToString(), dResultN:ToString() ) )
I think that under the hood this is translated to
- convert the NULL_DATE -> DateTime
- assign the Datetime to the Nullable<DateTime>
In the first step the DateTime gets set to DateTime.Minvalue because there no representation of a NULL_DATE in the DateTime type.
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
virtual method FieldGetNullableDateTime( cFieldName as string ) as Nullable<DateTime>
local dValue as Nullable<DateTime>
local dDate as date
dDate := ( date ) super:FieldGet( cFieldName )
if dDate == null_date
dValue := null
else
dValue := dDate
endif
return dValue
If you think that the actual behavior should be changed, I can add a ticket. I have preferred to ask before I do that.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it