def truncate(self, percentage):
self.validate_time_inversion()<EOL>if percentage < <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>" + str(percentage))<EOL><DEDENT>if percentage == <NUM_LIT:0>:<EOL><INDENT>return<EOL><DEDENT>discard_time = self.timedelta // int(<NUM_LIT:100>) * int(percentage / <NUM_LIT:2>)<EOL>self.__start_datetime += discard_time<EOL>self.__end_datetime -= discard_time<EOL>
Truncate ``percentage`` / 2 [%] of whole time from first and last time.

:param float percentage: Percentage of truncate.

:Sample Code:
    .. code:: python

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

        2015-03-22T10:00:00+0900 - 2015-03-22T10:10:00+0900 (0:10:00)
        2015-03-22T10:00:30+0900 - 2015-03-22T10:09:30+0900 (0:09:00)