Reputation: 4055
I have a timestamp which is being returned from Stripe which is 1695112577
... If i punch it into https://www.epochconverter.com/ it returns the correct date Tuesday, 19 September 2023
But if i try and use date-fns-tz
to convert it, it keeps returning 1970 ... I am trying to return it in the users timezone;
import { formatInTimeZone } from 'date-fns-tz'
formatInTimeZone(new Date('1695112577'), user.timezone, 'eeee, MMMM do yyyy h:mm aaa')
Upvotes: 0
Views: 96