def time_until(value):
    now = datetime.now()
try:
    difference = value - now
except:
    return value
if difference <= timedelta(minutes=1):
    return 'just now'
Calculate number of days between two dates inside Django templates