def set_end_datetime(self, value, timezone=None):
if value is None:<EOL><INDENT>self.__end_datetime = None<EOL>return<EOL><DEDENT>try:<EOL><INDENT>self.__end_datetime = typepy.type.DateTime(<EOL>value, strict_level=typepy.StrictLevel.MIN, timezone=timezone<EOL>).convert()<EOL><DEDENT>except typepy.TypeConversionError as e:<EOL><INDENT>raise ValueError(e)<EOL><DEDENT>
Set the end time of the time range.

:param datetime.datetime/str value: |param_end_datetime|
:raises ValueError: If the value is invalid as a |datetime| value.

:Sample Code:
    .. code:: python

        from datetimerange import DateTimeRange
        time_range = DateTimeRange()
        print(time_range)
        time_range.set_end_datetime("2015-03-22T10:10:00+0900")
        print(time_range)
:Output:
    .. parsed-literal::

        NaT - NaT
        NaT - 2015-03-22T10:10:00+0900