def granular_now(n=None, default_tz=None):
    """
    A datetime.now look-alike that returns times rounded to a five minute
    boundary. This helps the backend database to optimize/reuse/cache its
    queries by not creating a brand new query each time.

    Also useful if you are using johnny-cache or a similar queryset cache.
    """
    if n is None:
        n = timezone.now()
    if default_tz is None:
        default_tz = timezone.get_current_timezone()

    rounded_minute = (n.minute // 5) * 5
    d = datetime(n.year, n.month, n.day, n.hour, rounded_minute)
    if django.VERSION < (5,):
        return timezone.make_aware(d, default_tz, is_dst=True)
    else:
        return timezone.make_aware(d, default_tz)

    A datetime.now look-alike that returns times rounded to a five minute
    boundary. This helps the backend database to optimize/reuse/cache its
    queries by not creating a brand new query each time.

    Also useful if you are using johnny-cache or a similar queryset cache.
    
feincms/extensions/datepublisher.py