If you specifically want to use a timestamp, then you could try getting the time from a Date object, then use that as the key when storing your value. When you write to Firebase it automatically sorts the items in a branch by their key.
Also, if you have children in Firebase that themselves have multiple children, you can use OrderByChild() to order what you read by a specific child. The link below is to some documentation that has the orderByChild() method listed.
https://firebase.google.com/docs/reference/js/firebase.database.Reference#orderbychild