Library API
    Preparing search index...

    Function civilToDays

    • Computes Unix epoch days (days since 1970-01-01) from proleptic Gregorian calendar components. Pure integer arithmetic based on Howard Hinnant's Euclidean affine algorithms — zero heap allocations.

      Parameters

      • year: number

        Gregorian calendar year (e.g. 2026)

      • month: number

        1-indexed month (1..12)

      • day: number

        1-indexed day of month (1..31)

      Returns number

      Unix epoch days count

    • Computes Unix epoch days (days since 1970-01-01) from a date object. Accepts a native JavaScript Date (UTC), a Temporal date-time object, or any object containing { year, month, day } components.

      Parameters

      • date: Date | { calendarId?: string; day: number; month: number; year: number }

        Date instance or Temporal-compatible date object with { year, month, day }

      Returns number

      Unix epoch days count