0

I have converted a string into a date format in my firebase firestore database. The date is stored as a timestamp and appears in the table as 11 December 2022 00:00:00. This seems to be correct as when I edit the date in firestore it gives the same result. In javascript I use 'new Date (data.date *1000).toDateString()' - the date displays as '11 December 3991'. The data.date displays as 'Timestamp(seconds=1645747200, nanoseconds=0)'.

Any help appreciated

I have tried everything online with no success.

mikeimp
  • 13
  • 3
  • Simply use the [toDate()](https://firebase.google.com/docs/reference/js/firestore_.timestamp.md#timestamptodate) method – Phil May 25 '23 at 05:54

0 Answers0