Updated time to string conversion