def _timedelta_to_seconds(timedelta):
    """
    >>> _timedelta_to_seconds(datetime.timedelta(hours=3))
    10800
    >>> _timedelta_to_seconds(datetime.timedelta(hours=3, minutes=15))
    11700
    """
    return (timedelta.days * 86400 + timedelta.seconds + timedelta.
        microseconds // 1000)
