Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I check if a Variant is a TDateTime?

I have an object, that has one value, but that value can either be an integer, string, boolean or TDateTime. So, it is a Variant.

I use VarType() to check its type, but since VarType() has no 'varDate' or 'varDateTime', I am using 'varDouble', because as far as I can gather, a TDateTime is a double.

But that returns false. I also cannot use is to check if the Variant is TDateTime. Is there a way, or should I make some sort of type variable that determines which type the value is and use that to check it?

like image 521
Svip Avatar asked Feb 17 '23 04:02

Svip


1 Answers

Your assumptions are incorrect; there is in fact a varDate.

like image 189
Andreas Rejbrand Avatar answered Feb 28 '23 11:02

Andreas Rejbrand