diff --git a/plexapi/utils.py b/plexapi/utils.py index 531e406a..4f8ef01c 100644 --- a/plexapi/utils.py +++ b/plexapi/utils.py @@ -176,7 +176,11 @@ def toDatetime(value, format=None): """ if value and value is not None: if format: - value = datetime.strptime(value, format) + try: + value = datetime.strptime(value, format) + except ValueError: + # parsing failed + return None else: # https://bugs.python.org/issue30684 # And platform support for before epoch seems to be flaky.