firebase timestamp
import firebase from 'firebase';
{
timestamp: firebase.firestore.FieldValue.serverTimestamp(),
}
firebase timestamp
import firebase from 'firebase';
{
timestamp: firebase.firestore.FieldValue.serverTimestamp(),
}
firebase query timestamp
Query query = mFirestore.collection("rootcollection")
.orderBy("timestamp", Query.Direction.DESCENDING)
.whereEqualTo("month", 3);
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()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us