i realize there is absolutely 0 documentation on how to parse a firebase/firestore timestamp in react.
As it shows here https://firebase.google.com/docs/reference/android/com/google/firebase/Timestamp
Timestamp in firebase is composed of seconds and miliseconds.
var newobj={
uid_to:'K365J32fddel3QTxGG94VksXtQP2',
uid_from:'RqVngIRyiJV2XTogLSONZIqoe5h1',
monto:23,
fecha:new Date(),
user:{
from_name:"fabri"
},
status:'pending'
}
firestore.collection('transacciones').add(newobj);
}
Then in the console is showed as this
And when i do a query it brings this
Object {
"fecha": Timestamp {
"nanoseconds": 960000000,
"seconds": 1526130923,
},
"monto": 23,
"status": "pending",
"uid_from": "RqVngIRyiJV2XTogLSONZIqoe5h1",
"uid_to": "K365J32fddel3QTxGG94VksXtQP2",
"user": Object {
"from_name": "fabri",
},
}
How do i parse it into a simple date, or datetime again?