def _since(dt, moment):
    """Returns the time since for a date, like '1 year' or '12 hours'."""
    one_day = 3600 * 24

    # Bit silly having months and years since the filter is hard-coded to only
    # use this for datetimes less than 2 days old.
    periods = [
        (one_day * 365, u'year', u'years'),
        (one_day * 28, u'month', u'months'),
        (one_day, u'day', u'days'),
        (3600, u'hour', 'hours'),
        (60, u'minute', u'minutes'),
        (1, u'second', u'seconds'),
    ]

    delta = moment - dt
    delta_seconds = delta.total_seconds()

    for period, singular, plural in periods:
        num =  delta_seconds // period

        if num:
            form = singular if num == 1 else plural

            return u'%d %s' % (num, form)
    else:
        return u'0 seconds'