Created
April 30, 2021 18:48
-
-
Save LemonSpike/49bf7758ddaa2c287e67767764861b53 to your computer and use it in GitHub Desktop.
Swift Date Formatter for ISO8601 timestamps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
let dateFormatter = ISO8601DateFormatter() | |
let timestamp = "2021-04-30T18:11:29-06:00" | |
let date = dateFormatter.date(from: timestamp) | |
print(date) // 🎉 🤔 🎊 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment