Formatting timestamp using date-fns-tz keeps returning 1970

51 Views Asked by At

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')
0

There are 0 best solutions below