use ```elif isinstance(timestamp, basestr):```