// to get as date
const date = new TimeStamp(yourTimeStamp.seconds , yourTimeStamp.nanoseconds).toDate();
// to get as string
const date = new TimeStamp(yourTimeStamp.seconds , yourTimeStamp.nanoseconds).toDate().toDateString();
const created = firebase.firestore.Timestamp.fromDate(new Date()).toDate();
//date from firebase is represented as
let time = {
seconds: 1613748319,
nanoseconds: 47688698687,
}
const fireBaseTime = new Date(
time.seconds * 1000 + time.nanoseconds / 1000000,
);
const date = fireBaseTime.toDateString();
const atTime = fireBaseTime.toLocaleTimeString();
console.log(date, atTime);
Run code snippet