I'm getting "TimestampNanos": 1619166999211820716 from a API. Only need to translate this to date and time in my React JS. Tried all kind of solution no one works.
Try:
const date = new Date(timeStampNanos / 1000000)
// For the timestamp in your question, this yields a date & time in April of 2021
// Which seems about right :)
The date constructor in JS takes in a timestamp in milliseconds, so you need to divide it by 1 million - the amount of nanoseconds in 1 millisecond.