vercel / nextjs-subscription-payments

Clone, deploy, and fully customize a SaaS subscription application with Next.js.
https://subscription-payments.vercel.app/
MIT License
5.83k stars 1.19k forks source link

Incorrectly converting stripe timestamps to DateTimes #225

Closed ericallam closed 5 months ago

ericallam commented 11 months ago

Currently timestamps are hydrated to Dates using the following function:

export const toDateTime = (secs: number) => {
  var t = new Date('1970-01-01T00:30:00Z'); // Unix epoch start.
  t.setSeconds(secs);
  return t;
};

A couple issues here:

leerob commented 5 months ago

https://github.com/vercel/nextjs-subscription-payments/pull/278