from datetime import datetime, timezone


def utc_now() -> datetime:
    return datetime.now(timezone.utc)


def split_cron(cron: str) -> dict[str, str]:
    parts = cron.split()
    if len(parts) != 5:
        raise ValueError("SCHEDULE_CRON 需要使用 5 段 cron 表达式，例如 0 1 * * *")
    minute, hour, day, month, day_of_week = parts
    return {
        "minute": minute,
        "hour": hour,
        "day": day,
        "month": month,
        "day_of_week": day_of_week,
    }

