Convert a Date in Xcode to timestamp before adding to firestore – Ios swift
I have a @State var tripDate = Date() I want to add to firestore db func addData(tripDate: Date) { // Get a reference to the database let db = Firestore.firestore() // Add a document to a collection db.collection("tripDate":tripDate]) { error…