Moved datetime to text into to_csv function still using ISO8601 format