Answers for "firebase timestamp to datetime"

2

firebase timestamp

import firebase from 'firebase';

{
	timestamp: firebase.firestore.FieldValue.serverTimestamp(),
}
Posted by: Guest on June-07-2021
1

firebase query timestamp

Query query = mFirestore.collection("rootcollection")
    .orderBy("timestamp", Query.Direction.DESCENDING)
    .whereEqualTo("month", 3);
Posted by: Guest on June-02-2021
0

convert firebase timestamp to date

SimpleDateFormat sfd = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
sfd.format(new Date(timestamp));

If you are looking to get a Date instance from Timestamp
If you need to get just the Date object from Timestamp, the Timestamp instance comes with a toDate() method that returns a Date instance.

For clarity:

Date javaDate = firebaseTimestampObject.toDate()
Posted by: Guest on June-03-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language