from pathlib import Path
from datetime import datetime


def _age(path: Path) -> int:
    """
    Calculate age of log file at `path` in days.

    The creation timestamp is extracted from the ISO filename.
    """
    created_at = datetime.fromisoformat(path.stem)
    difference = datetime.utcnow() - created_at

    return difference.days