+ 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.

29th Aug 2018, 5:11 AM
Lucas Tivana
Lucas Tivana - avatar
2 Antworten
+ 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
29th Aug 2018, 5:37 AM
Burey
Burey - avatar
0
thank you
29th Aug 2018, 5:53 AM
Lucas Tivana
Lucas Tivana - avatar