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
Use isinstance.
isinstance
if isinstance(variable,datetime.datetime): print "Yay!"