Python Execute Function From String To Datetime