Solution - Typeerror '<' not supported between instances of 'datetime.datetime' and 'str' while Sorted()
sorted(self.total_played_game_details, key=lambda i: i['start_datetime'], reverse=True)
Type error '<' not supported between instances of 'datetime.datetime' and 'str'
Solution
from datetime import datetime
sorted(self.total_played_game_details, key=lambda i: datetime.strptime(str(i['start_datetime']), "%Y-%m-%d %H:%M:%S"))
Comments
Post a Comment