I have a variable and I need to know if it is a datetime object.
So far I have been using the following hack in the function to detect datetime object:
i
isinstance is your friend
isinstance
>>> thing = "foo" >>> isinstance(thing, str) True