The following works fine in c# (assuming value
is an object
):
if (value is DateTime)
What is the equivalent check for VB.NET?
Creating a DateTime ObjectBy assigning the DateTime object a date and time value returned by a property or method. By parsing the string representation of a date and time value. By calling the DateTime structure's implicit default constructor.
You must specify the date value in the format M/d/yyyy, for example #5/31/1993# , or yyyy-MM-dd, for example #1993-5-31# . You can use slashes when specifying the year first. This requirement is independent of your locale and your computer's date and time format settings.
“DateTime is a value type (a structure) and can not be set to null or nothing as with all . Net value types. The default value for a datetime value is zeros for the date portion and 12:00:00 AM for the Time portion.”
The VB.Net equivalent is
If TypeOf(value) Is DateTime Then
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With