def getDateTime(value=None):
 if (value is None):
  return datetime.datetime.today()
 if isinstance(value, datetime.datetime):
  return value
 if isinstance(value, datetime.date):
  return datetime.datetime.fromordinal(value.toordinal())
 if isinstance(value, (int, long, float)):
  return datetime.datetime.fromtimestamp(value)
 if isinstance(value, basestring):
  raise NotImplementedError("Strings aren't currently implemented")
 if hasattr(value, '__getitem__'):
  return datetime.datetime(*tuple(value)[:6])
 return datetime.datetime.fromtimestamp(value.ticks())

def getDateTime ( value = None ) : if ( value is None ) : return datetime . datetime . today ( ) if isinstance ( value , datetime . datetime ) : return value if isinstance ( value , datetime . date ) : return datetime . datetime . fromordinal ( value . toordinal ( ) ) if isinstance ( value , ( int , long , float ) ) : return datetime . datetime . fromtimestamp ( value ) if isinstance ( value , basestring ) : raise NotImplementedError ( "Strings aren't currently implemented" ) if hasattr ( value , '__getitem__' ) : return datetime . datetime ( * tuple ( value ) [ : 6 ] ) return datetime . datetime . fromtimestamp ( value . ticks ( ) )
return datetime .