Python Trim String Length Sql Function Datediff