+ 1
Chat App timestamp
hy guys i hv created an Android chat app using firebase, whenever i send a message it sends but theres no timestamp, please assist me to add a timestamp on chat messages.
2 ответов
+ 10
add a Firebase ServerValue.TIMESTAMP constant:
posts_ref.push({
author: data.author,
body: data.body,
createTime: firebase.database.ServerValue.TIMESTAMP
});
this constant will be populated by the firebase server once it been sent (it will be an actual timestamp when you retrieve the message)
https://firebase.google.com/docs/reference/js/firebase.database.ServerValue
0
thank you