Firebase Time Format broken after update
// ISSUE IS SOLVED
Hi guys,
Buildship seems to have changed the date format to a number format.
I posted a message in "feedback" - I hope someone can help me with an issue concerning a changed date format in Firebase database entries after an update at Buildship. Thanks.
Here is my original message:
https://discord.com/channels/853498675484819476/883975617987608576/1253113956021571756
Solution:Jump to solution
Hi @Thomas, try with this updated Firestore node, it should then work, we'll do more testing and will update the node in the explorer. Copy the content from the above file and paste it https://docs.buildship.com/features/copy-paste#paste-node.
10 Replies
This is my firebase database entries before and after the update of the firebase node.
Solution
Hi @Thomas, try with this updated Firestore node, it should then work, we'll do more testing and will update the node in the explorer. Copy the content from the above file and paste it https://docs.buildship.com/features/copy-paste#paste-node.
It should work fine with data value -
{"dateAt": new Date()}
Hi @Thomas The node is also updated in the library as well, you can refresh the app and add the nod again.
Dear @Gaurav Chadha perfect! You made my day 🙂 Thanks
Dear @Gaurav Chadha , I discovered an issue in firestore dates:
I can now create a date in field "date1" using new Date () in "collection1". Next I take the value of "date1“ to define the field "date2" in "collection2". I get a similar issue like we had before.
Here is what I tried also: wrapping the timestamp into a new Date(). This leads to an error.
@Thomas it's not an issue with the node this is time in reference works, you'll require to convert the format, you can refer to this https://firebase.google.com/docs/reference/js/v8/firebase.firestore.Timestamp
OK, got it - thanks so much!
This helped:
https://stackoverflow.com/a/58104246/22473529
Stack Overflow
How do I convert a Firestore date/Timestamp to a JS Date()?
I am trying to convert the below date to a javascript Date() object. When I get it back from the server, it is a Timestamp object,
Screenshot from Firebase Firestore console:
When I try the foll...
Hello folks, since you were playing a lot with timestamp, can you help me with the filter I shoud write to get a document with a specific timestamp?
If I don't use any filter the fields looks like this
"birthdate": {
"_seconds": -79668000,
"_nanoseconds": 0
}
but even if I filter to look at the specific document I get and empty answer
{"operator":"==","value":-79668000,"field":"birthdate._seconds"}
same as
{"operator":"==","value":-79668000,"field":"birthdate"}
Can you help me?