In my chat app(using firebase) I used to store time stamps of messages like this
msg = {
// ...
timestamp: serverTimestamp(),
};
When the msg document was retrieved and parsed into javascript date object
const date = new Date(timestamp * 1000);
const year = date.getFullYear();
The getFullYear() method returns 3991 instead of 2022
could anyone help me to fix this ?