@bates-solutions/stripe API Reference - v2.2.1
    Preparing search index...

    Function toUnixTime

    • Convert a JS Date to Unix seconds, the time format Stripe expects. A number is taken to be Unix seconds already and passed through.

      Parameters

      • value: number | Date

        A Date, or whole Unix seconds

      • field: string = 'value'

        Field name reported on a validation error

      Returns number

      When the value is an invalid Date, not a whole number, or looks like milliseconds (above 1e11, i.e. after the year 5000)

      toUnixTime(new Date('2026-03-01T00:00:00Z')); // 1772323200