code: def naturaldate(date, include_seconds=False):
      
  
      if not date:
          return ''
  
      right_now = now()
      today = datetime(right_now.year, right_now.month,
                       right_now.day, tzinfo=right_now.tzinfo)
      delta = right_now - date
      delta_midnight = today - date
  
      days = delta.days
      hours = delta.seconds // 3600
      minutes = delta.seconds // 60
      seconds = delta.seconds
  
      if days < 0:
          return _('just now')
  
      if days == 0:
          if hours == 0:
              if minutes > 0:
                  return ungettext(
                      _('{minutes} minute ago'),
                      _('{minutes} minutes ago'), minutes
                  ).format(minutes=minutes)
              else:
                  if include_seconds and seconds:
                      return ungettext(
                          _('{seconds} second ago'),
                          _('{seconds} seconds ago'), seconds
                      ).format(seconds=seconds)
                  return _('just now')
          else:
              return ungettext(
                  _('{hours} hour ago'), _('{hours} hours ago'), hours
              ).format(hours=hours)
  
      if delta_midnight.days == 0:
          return _('yesterday at {time}').format(time=date.strftime('%H:%M'))
  
      count = 0
      for chunk, pluralizefun in OLDER_CHUNKS:
          if days >= chunk:
              count = int(round((delta_midnight.days + 1) / chunk, 0))
              fmt = pluralizefun(count)
              return fmt.format(num=count)
docs: Convert datetime into a human natural date string.