'Internal helper which will return a ``datetime.timedelta``
representing the time between ``now`` and ``then``. Assumes
``now`` is a ``datetime.date`` or ``datetime.datetime`` later
than ``then``.
If ``now`` and ``then`` are not of the same type due to one of
them being a ``datetime.date`` and the other being a
``datetime.datetime``, both will be coerced to
``datetime.date`` before calculating the delta.'

def _get_delta(self, now, then):

    if (now.__class__ is not then.__class__):
        now = datetime.date(now.year, now.month, now.day)
        then = datetime.date(then.year, then.month, then.day)
    if (now < then):
        raise ValueError('Cannot    determine    moderation    rules    because    date    field    is    set    to    a    value    in    the    future')
    return (now - then)
