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

    Function fromUnixTime

    • Convert a Unix timestamp (seconds) to a JS Date.

      Stripe expresses times as Unix epoch seconds; this saves consumers from the repetitive new Date(value * 1000).

      Parameters

      • seconds: number | null | undefined

        Unix time in seconds (e.g. subscription.current_period_end)

      Returns Date | undefined

      A Date, or undefined if the input is null/undefined

      fromUnixTime(1700000000); // Date
      fromUnixTime(null); // undefined