Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #firebase #timestamp #date
ADD COMMENT
Topic
Name
4+7 =