I would like to know how to calculate the difference between the login time and log out time, for Example: Login time: 8:00 AM and Logout time: 5:00 PM, and I should get 9 hours as total hours rendered.
This is the format of the time that is saved to Firebase
// Set the time
let timeFormatter = DateFormatter()
timeFormatter.dateStyle = .none
timeFormatter.timeStyle = .short
timeFormatter.amSymbol = "AM"
timeFormatter.pmSymbol = "PM"
let timeString = timeFormatter.string(from: date)