How to get the current date and time in Swift

1 Answer

0 votes
import Foundation

let today = Date()

print(today)





/*
run:

2021-06-18 09:33:46 +0000

*/

 



answered Jun 18, 2021 by avibootz
...