def age(
    from_date: Union[int, float, None],  # POSIX timestamp
    *,
    since_date: datetime = None,
    target_tz=None,
    include_seconds: bool = False,
) -> str:
    """Takes a timestamp and returns a string with the approximation of the age"""
    if from_date is None:
        return _("Unknown")
    from_date = datetime.fromtimestamp(from_date)
    if since_date is None:
        since_date = datetime.now(target_tz)
    distance_in_time = from_date - since_date
    is_in_past = from_date < since_date
    s = delta_time_str(distance_in_time, include_seconds=include_seconds)
    return _("{} ago").format(s) if is_in_past else _("in {}").format(s)
Takes a timestamp and returns a string with the approximation of the age
electrum/util.py