set past date in swift ios code example Example: How to create a Swift Date object let currentDateTime = Date()