Convert a JS Date to Unix seconds, the time format Stripe expects. A number is taken to be Unix seconds already and passed through.
Date
A Date, or whole Unix seconds
Field name reported on a validation error
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 Copy
toUnixTime(new Date('2026-03-01T00:00:00Z')); // 1772323200
Convert a JS
Dateto Unix seconds, the time format Stripe expects. A number is taken to be Unix seconds already and passed through.